html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

body.splash-open .topbar {
  position: static;
}

.splash-screen {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.splash-content {
  align-self: start;
  padding-top: max(28px, env(safe-area-inset-top));
}

.splash-content h1 {
  font-size: clamp(2.4rem, 12vw, 5.2rem);
  line-height: 1;
  overflow-wrap: anywhere;
}

.splash-copy {
  font-size: 1rem;
  line-height: 1.45;
}

.splash-profile {
  min-height: auto;
  padding: 16px 18px 18px;
  border-radius: 18px;
}

.splash-profile span {
  padding-right: 56px;
}

.feature-card img,
.place-preview img,
.detail-hero img {
  background: #eef4f1;
  object-fit: cover;
}

.bottom-nav {
  max-width: 100vw;
}

.bottom-nav a[aria-current="page"] {
  color: #1f78a4;
  background: rgba(31, 120, 164, 0.1);
}

.badge-shelf {
  grid-auto-columns: minmax(128px, max-content);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding: 2px 2px 8px;
  scrollbar-width: thin;
}

.badge-pill {
  min-height: 56px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.badge-pill span,
.badge-pill small {
  display: block;
}

.action-row {
  max-width: 100%;
}

.action-row > * {
  min-width: 0;
}

.weather-grid,
.badge-grid,
.source-grid,
.dashboard-grid,
.feature-strip,
.learning-hub {
  max-width: 100%;
}

.learning-hub {
  display: grid;
  gap: 14px;
}

.icon-menu-button {
  min-height: 42px;
  border-radius: 999px;
  padding-inline: 16px;
}

.main-menu {
  position: fixed;
  inset: 0;
  z-index: 220;
  padding: max(18px, env(safe-area-inset-top)) 16px 16px;
  background: rgba(12, 24, 20, 0.48);
}

.main-menu-card {
  max-width: 560px;
  margin-left: auto;
  border: 1px solid rgba(20, 32, 26, 0.16);
  border-radius: 20px;
  background: #fffdf7;
  padding: 16px;
  box-shadow: 0 22px 70px rgba(20, 32, 26, 0.25);
}

.menu-link-grid,
.nearby-list,
.attraction-list,
.journal-list {
  display: grid;
  gap: 10px;
}

.menu-link {
  display: grid;
  gap: 4px;
  text-align: left;
  min-height: 68px;
}

.menu-link span {
  color: #536159;
  font-size: 0.86rem;
  font-weight: 700;
}

.top-badge-row {
  margin-bottom: 12px;
}

.top-badge-preview {
  max-width: 1180px;
  margin: 0 auto 10px;
  border: 1px solid rgba(20, 32, 26, 0.12);
  border-radius: 18px;
  background: rgba(255, 253, 247, 0.88);
  padding: 12px;
  box-shadow: 0 14px 34px rgba(20, 32, 26, 0.08);
}

.map-first-shell {
  max-width: 1180px;
  margin: 0 auto 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  position: relative;
}

.map-stage {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(20, 32, 26, 0.13);
  border-radius: 18px 18px 0 0;
  background: #dfe9e5;
  min-height: 56svh;
}

.map-stage-head {
  position: absolute;
  z-index: 4;
  inset: 10px 10px auto;
  align-items: center;
  margin: 0;
  padding: 10px;
  border: 1px solid rgba(20, 32, 26, 0.12);
  border-radius: 14px;
  background: rgba(255, 253, 247, 0.9);
  backdrop-filter: blur(14px);
}

.map-stage-head h2 {
  font-size: 1.2rem;
}

.map-stage-actions,
.compact-actions,
.drawer-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.map-stage-actions button,
.compact-actions button,
.compact-actions .external-link,
.drawer-chips button {
  min-height: 38px;
  max-height: 44px;
  padding-inline: 10px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 850;
}

.route-map-home,
.static-route-map {
  min-height: 56svh;
}

.static-route-map {
  display: grid;
  grid-template-rows: minmax(300px, 1fr) auto;
  position: relative;
  background:
    radial-gradient(circle at 80% 8%, rgba(242, 193, 78, 0.35), transparent 16%),
    linear-gradient(145deg, #dcecea 0%, #f7f1df 100%);
}

.static-route-map svg {
  width: 100%;
  height: 100%;
  min-height: 330px;
  padding-top: 64px;
}

.static-route-shadow,
.static-route-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.static-route-shadow {
  stroke: rgba(20, 32, 26, 0.18);
  stroke-width: 32;
}

.static-route-line {
  stroke: #1f78a4;
  stroke-width: 9;
}

.static-stop {
  fill: #fffdf7;
  stroke: #163f33;
  stroke-width: 5;
}

.static-stop.ferry,
.static-stop.arrival {
  stroke: #bd5a36;
}

.static-attraction circle {
  fill: #f2c14e;
  stroke: #163f33;
  stroke-width: 4;
}

.static-attraction.is-saved circle {
  fill: #a9d18e;
}

.static-attraction.is-visited circle {
  fill: #bd5a36;
}

.map-pin-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.interactive-map-pin {
  position: absolute;
  z-index: 5;
  width: 32px;
  height: 32px;
  min-height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 2px solid #fffdf7;
  border-radius: 999px;
  background: #1f78a4;
  color: #fffdf7;
  box-shadow: 0 8px 18px rgba(20, 32, 26, 0.22);
  transform: translate(-50%, -50%);
  pointer-events: auto;
}

.interactive-map-pin span {
  font-size: 0.9rem;
  line-height: 1;
}

.interactive-map-pin.category-national-park { background: #2f7d5f; }
.interactive-map-pin.category-historic-site { background: #7c5d3a; }
.interactive-map-pin.category-museum { background: #174a7c; }
.interactive-map-pin.category-lighthouse { background: #205f86; }
.interactive-map-pin.category-waterfall { background: #1f78a4; }
.interactive-map-pin.category-food-stop { background: #bd5a36; }
.interactive-map-pin.category-oddity { background: #8c5bb0; }
.interactive-map-pin.category-photo-stop { background: #54605a; }
.interactive-map-pin.category-ferry { background: #163f33; }

.map-marker.is-attraction.category-national-park { background: #2f7d5f; }
.map-marker.is-attraction.category-historic-site { background: #7c5d3a; }
.map-marker.is-attraction.category-museum { background: #174a7c; }
.map-marker.is-attraction.category-lighthouse { background: #205f86; }
.map-marker.is-attraction.category-waterfall { background: #1f78a4; }
.map-marker.is-attraction.category-food-stop { background: #bd5a36; }
.map-marker.is-attraction.category-oddity { background: #8c5bb0; }
.map-marker.is-attraction.category-photo-stop { background: #54605a; }
.map-marker.is-attraction.category-ferry { background: #163f33; }

.interactive-map-pin.is-saved {
  outline: 3px solid #f2c14e;
}

.interactive-map-pin.is-visited {
  box-shadow: 0 0 0 4px rgba(189, 90, 54, 0.24), 0 8px 18px rgba(20, 32, 26, 0.22);
}

.static-gps {
  fill: #bd5a36;
  stroke: #fffdf7;
  stroke-width: 5;
}

.static-route-map text {
  fill: #14201a;
  font-size: 19px;
  font-weight: 850;
  paint-order: stroke;
  stroke: rgba(255, 253, 247, 0.82);
  stroke-width: 4px;
}

.static-attraction text {
  font-size: 14px;
}

.static-map-pins {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px;
  background: rgba(255, 253, 247, 0.9);
}

.static-map-pins button {
  min-width: 160px;
  min-height: 54px;
  display: grid;
  text-align: left;
  align-content: center;
  gap: 2px;
}

.static-map-pins span,
.drawer-row span {
  color: #536159;
  font-size: 0.78rem;
  font-weight: 750;
}

.map-preview-card {
  position: absolute;
  z-index: 6;
  left: 10px;
  right: 10px;
  bottom: 12px;
}

.attraction-preview-card,
.photo-analysis-card,
.stop-detail-card {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 12px;
  border: 1px solid rgba(20, 32, 26, 0.13);
  border-radius: 14px;
  background: #fffdf7;
  padding: 10px;
  box-shadow: 0 18px 44px rgba(20, 32, 26, 0.16);
}

.attraction-preview-card img,
.photo-analysis-card > img,
.stop-detail-card img {
  width: 100%;
  height: 100%;
  min-height: 116px;
  object-fit: cover;
  border-radius: 10px;
}

.attraction-preview-card h3,
.photo-analysis-card h3,
.stop-detail-card h3 {
  margin: 0;
  font-size: 1.08rem;
}

.stop-detail-drawer {
  padding-bottom: 4px;
}

.bottom-drawer {
  border: 1px solid rgba(20, 32, 26, 0.13);
  border-top: 0;
  border-radius: 0 0 18px 18px;
  background: rgba(255, 253, 247, 0.96);
  box-shadow: 0 14px 34px rgba(20, 32, 26, 0.1);
}

.bottom-drawer details {
  padding: 10px 12px;
}

.bottom-drawer summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  list-style: none;
}

.bottom-drawer summary::-webkit-details-marker {
  display: none;
}

.bottom-drawer summary span {
  display: grid;
  gap: 2px;
}

.bottom-drawer summary small {
  color: #536159;
  font-weight: 750;
}

.bottom-drawer summary b {
  border-radius: 999px;
  background: #eef8fb;
  color: #16465c;
  padding: 6px 10px;
  font-size: 0.8rem;
}

.drawer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding-top: 12px;
}

.drawer-grid h3 {
  margin: 0 0 6px;
  font-size: 0.96rem;
}

.drawer-row {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  min-height: 42px;
  text-align: left;
  margin-bottom: 6px;
}

.photo-analysis-stack {
  display: grid;
  gap: 12px;
}

.photo-analysis-body {
  display: grid;
  gap: 8px;
}

.analysis-result {
  border: 1px solid rgba(20, 32, 26, 0.1);
  border-radius: 12px;
  background: #f8fbf8;
  padding: 10px;
}

.analysis-result h4 {
  margin: 8px 0 2px;
  font-size: 0.86rem;
}

.notes-field {
  display: grid;
  gap: 6px;
  color: #536159;
  font-size: 0.82rem;
  font-weight: 850;
}

.notes-field textarea {
  width: 100%;
  min-height: 74px;
  resize: vertical;
  border: 1px solid rgba(20, 32, 26, 0.13);
  border-radius: 12px;
  background: #fffdf7;
  padding: 10px;
}

.inline-confirm,
.warning-note {
  border: 1px solid rgba(189, 90, 54, 0.24);
  border-radius: 12px;
  background: #fff1e8;
  color: #7b351e;
  padding: 8px;
  font-weight: 800;
}

.inline-confirm {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: space-between;
}

.trip-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.attraction-history {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.attraction-history section {
  border: 1px solid rgba(20, 32, 26, 0.11);
  border-radius: 12px;
  background: #fffdf7;
  padding: 10px;
}

.attraction-history h4 {
  margin: 0 0 8px;
}

.attraction-history button {
  width: 100%;
  min-height: 46px;
  display: grid;
  text-align: left;
  margin-top: 6px;
}

.attraction-history span {
  color: #536159;
  font-size: 0.78rem;
  font-weight: 750;
}

.trip-stats span {
  border: 1px solid rgba(20, 32, 26, 0.11);
  border-radius: 12px;
  background: #fffdf7;
  padding: 8px;
}

.trip-stats strong,
.trip-stats small {
  display: block;
}

.memory-timeline {
  display: grid;
  gap: 8px;
}

.memory-timeline article {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 10px;
  border-left: 3px solid #1f78a4;
  padding-left: 10px;
}

.fallback-cluster-map {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(20, 32, 26, 0.12);
  border-radius: 18px;
  background:
    linear-gradient(90deg, rgba(31, 120, 164, 0.12), transparent 42%),
    #f7fbf9;
}

.cluster-card {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(20, 32, 26, 0.12);
  border-radius: 16px;
  background: #fffdf7;
  padding: 10px;
}

.cluster-head {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 50px;
  text-align: left;
}

.cluster-head span {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: #1f78a4;
  color: #fffdf7;
  font-weight: 900;
}

.cluster-items {
  display: grid;
  gap: 6px;
}

.cluster-items button {
  display: grid;
  gap: 2px;
  min-height: 58px;
  text-align: left;
}

.cluster-items small {
  color: #536159;
  font-weight: 750;
}

.map-marker.is-attraction {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 3px solid #163f33;
  background: #f2c14e;
  color: #163f33;
  font-size: 1.4rem;
  line-height: 1;
}

.journal-entry {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  gap: 12px;
}

.journal-entry .summary-photo {
  min-height: 130px;
}

.tag-list span {
  border: 1px solid rgba(31, 120, 164, 0.25);
  border-radius: 999px;
  background: #eef8fb;
  padding: 6px 9px;
  font-size: 0.8rem;
  font-weight: 800;
}

.radar-card iframe {
  width: 100%;
  min-height: 360px;
  border: 1px solid rgba(20, 32, 26, 0.14);
  border-radius: 14px;
  background: #eef4f1;
}

.radar-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.app-modal {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(12, 24, 20, 0.48);
}

.app-modal-card {
  position: relative;
  width: min(560px, 100%);
  max-height: min(78vh, 680px);
  overflow-y: auto;
  padding: 22px;
  border: 1px solid rgba(20, 32, 26, 0.14);
  border-radius: 18px;
  background: #fffdf7;
  box-shadow: 0 22px 70px rgba(20, 32, 26, 0.28);
}

.app-modal-card h3 {
  margin: 4px 0 10px;
  font-size: 1.55rem;
}

.modal-close {
  float: right;
  min-height: 42px;
  padding-inline: 14px;
}

@media (max-width: 840px) {
  .splash-screen {
    display: block;
  }

  .splash-visual {
    min-height: 130px;
    max-height: 160px;
    overflow: hidden;
  }

  .splash-content {
    padding: 18px 16px calc(28px + env(safe-area-inset-bottom));
  }

  .splash-content h1 {
    margin-top: 4px;
  }

  .splash-profiles {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 18px;
  }

  .splash-profile strong {
    font-size: 1.24rem;
  }

  .splash-profile span {
    font-size: 0.86rem;
    line-height: 1.3;
  }

  .topbar {
    position: static;
  }

  .today-summary-card,
  .progress-band,
  .top-badge-preview,
  .map-first-shell,
  .profile-section,
  .profile-view,
  .choice-card,
  .dashboard-hero {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .dashboard-grid,
  .weather-grid,
  .badge-grid,
  .source-grid,
  .feature-strip,
  .route-actions,
  .sun-metrics {
    grid-template-columns: 1fr;
  }

  .feature-card {
    min-height: 118px;
  }

  .feature-card img {
    height: 88px;
  }

  .action-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .top-actions {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .main-menu-card {
    max-width: none;
    max-height: calc(100vh - 32px - env(safe-area-inset-top));
    overflow-y: auto;
  }

  .place-preview,
  .journal-entry,
  .attraction-preview-card,
  .photo-analysis-card,
  .stop-detail-card {
    grid-template-columns: 1fr;
  }

  .place-preview img,
  .journal-entry .summary-photo,
  .attraction-preview-card img,
  .photo-analysis-card > img,
  .stop-detail-card img {
    height: 170px;
  }

  .map-stage,
  .route-map-home,
  .static-route-map {
    min-height: 58svh;
  }

  .map-preview-card {
    position: static;
    padding: 10px;
  }

  .drawer-grid {
    grid-template-columns: 1fr;
  }

  .attraction-history {
    grid-template-columns: 1fr;
  }

  .static-route-map text {
    font-size: 15px;
  }

  .static-attraction text {
    display: none;
  }

  .bottom-nav a {
    font-size: 0.72rem;
    padding-inline: 2px;
  }

  .badge-shelf {
    grid-auto-flow: row;
    grid-auto-columns: unset;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }

  .radar-card iframe {
    min-height: 300px;
  }
}

@media (max-width: 430px) {
  .badge-shelf {
    grid-template-columns: 1fr;
  }
}

body:not([data-page="route"]):not([data-page="explore"]) .map-first-shell,
body:not([data-page="route"]):not([data-page="explore"]) .top-badge-preview {
  display: none;
}

body[data-page="route"] .today-summary-card,
body[data-page="explore"] .today-summary-card,
body[data-page="route"] .progress-band,
body[data-page="explore"] .progress-band,
body[data-page="route"] .profile-section,
body[data-page="explore"] .profile-section,
body[data-page="route"] .bottom-nav,
body[data-page="explore"] .bottom-nav {
  display: none;
}

body[data-page="route"] .app-shell,
body[data-page="explore"] .app-shell {
  min-height: 100svh;
  padding: 0;
  overflow: hidden;
}

body[data-page="route"] main,
body[data-page="explore"] main {
  display: block;
}

body[data-page="route"] .topbar,
body[data-page="explore"] .topbar {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  left: 14px;
  right: 14px;
  z-index: 25;
  width: auto;
  max-width: none;
  margin: 0;
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid rgba(20, 32, 26, 0.14);
  border-radius: 18px;
  background: rgba(255, 253, 247, 0.9);
  box-shadow: 0 18px 48px rgba(20, 32, 26, 0.14);
}

body[data-page="route"] .topbar-identity,
body[data-page="explore"] .topbar-identity {
  min-width: 0;
}

body[data-page="route"] .topbar h1,
body[data-page="explore"] .topbar h1 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: clamp(1.05rem, 2vw, 1.45rem);
}

body[data-page="route"] .topbar-meta,
body[data-page="explore"] .topbar-meta {
  margin: 0;
  overflow: hidden;
  color: #536159;
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-page="route"] .top-actions,
body[data-page="explore"] .top-actions {
  min-width: 0;
  flex-wrap: nowrap;
}

body[data-page="route"] .top-actions button,
body[data-page="explore"] .top-actions button,
body[data-page="route"] .status-pill,
body[data-page="explore"] .status-pill {
  min-height: 38px;
  white-space: nowrap;
}

body[data-page="route"] .traveler-chip,
body[data-page="explore"] .traveler-chip {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}

body[data-page="route"] .top-badge-preview,
body[data-page="explore"] .top-badge-preview {
  position: fixed;
  left: max(14px, env(safe-area-inset-left));
  right: max(14px, env(safe-area-inset-right));
  bottom: max(8px, env(safe-area-inset-bottom));
  z-index: 18;
  max-width: none;
  margin: 0 auto;
  padding: 8px;
  border-radius: 18px;
  background: rgba(255, 253, 247, 0.92);
  border: 1px solid rgba(20, 32, 26, 0.14);
  box-shadow: 0 18px 48px rgba(20, 32, 26, 0.18);
  backdrop-filter: blur(16px);
}

.adventure-badge-tray {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 78px;
  gap: 8px;
  max-height: 72px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

.adventure-badge-tray::-webkit-scrollbar {
  display: none;
}

.adventure-badge {
  position: relative;
  min-height: 64px;
  height: 64px;
  min-width: 0;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  grid-template-rows: 1fr auto;
  align-items: center;
  gap: 0 5px;
  padding: 5px 6px;
  border-radius: 14px;
  background: #fffdf7;
  border: 1px solid rgba(20, 32, 26, 0.14);
  text-align: left;
  overflow: hidden;
}

.adventure-badge .badge-doodle-svg {
  width: 34px;
  height: 34px;
  grid-row: 1 / 3;
}

.adventure-badge span {
  min-width: 0;
  color: #14201a;
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1.05;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.adventure-badge small {
  color: #536159;
  font-size: 0.66rem;
  font-weight: 850;
}

.adventure-badge i {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, #163f33, #1f78a4);
}

.adventure-badge.is-earned {
  background: #eef8ef;
}

.map-stop-count {
  min-height: 34px;
  display: inline-grid;
  place-items: center;
  padding: 0 10px;
  border: 1px solid rgba(20, 32, 26, 0.12);
  border-radius: 999px;
  background: rgba(255, 253, 247, 0.78);
  color: #16465c;
  font-size: 0.78rem;
  font-weight: 900;
}

.home-cluster-map,
body[data-page="route"] .route-map-home,
body[data-page="explore"] .route-map-home,
body[data-page="route"] .map-stage,
body[data-page="explore"] .map-stage {
  width: 100vw;
  min-height: 100svh;
  height: 100svh;
}

body[data-page="route"] .route-map-home,
body[data-page="explore"] .route-map-home {
  position: relative;
}

.home-dom-marker-layer {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
}

.home-dom-marker-layer button {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: auto;
}

.dom-map-cluster {
  width: 42px;
  height: 42px;
  min-height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 4px solid #fffdf7;
  border-radius: 999px;
  background: #1f78a4;
  color: #fffdf7;
  font-weight: 950;
  box-shadow: 0 10px 24px rgba(20, 32, 26, 0.28);
}

.dom-map-pin {
  width: 30px;
  height: 30px;
  min-height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 3px solid #fffdf7;
  border-radius: 999px;
  background: #f2c14e;
  color: #14201a;
  font-size: 0.78rem;
  font-weight: 950;
  box-shadow: 0 8px 20px rgba(20, 32, 26, 0.25);
}

.dom-map-pin.category-nature { background: #2f7d5f; color: #fffdf7; }
.dom-map-pin.category-history { background: #7c5d3a; color: #fffdf7; }
.dom-map-pin.category-museum { background: #174a7c; color: #fffdf7; }
.dom-map-pin.category-food { background: #bd5a36; color: #fffdf7; }
.dom-map-pin.category-ferry { background: #163f33; color: #fffdf7; }
.dom-map-pin.category-water { background: #1f78a4; color: #fffdf7; }
.dom-map-pin.category-discovery { background: #f2c14e; color: #14201a; }

body[data-page="route"] .map-first-shell,
body[data-page="explore"] .map-first-shell {
  width: 100vw;
  max-width: none;
  min-height: 100svh;
  margin: 0;
}

body[data-page="route"] .map-stage,
body[data-page="explore"] .map-stage {
  border: 0;
  border-radius: 0;
  overflow: hidden;
}

body[data-page="route"] .map-stage-head,
body[data-page="explore"] .map-stage-head {
  inset: 86px 16px auto auto;
  width: min(460px, calc(100vw - 32px));
}

body[data-page="route"] .map-preview-card,
body[data-page="explore"] .map-preview-card {
  left: 16px;
  right: auto;
  bottom: calc(92px + env(safe-area-inset-bottom));
  width: min(540px, calc(100vw - 32px));
}

.cluster-drawer {
  position: fixed;
  z-index: 19;
  left: 16px;
  right: 16px;
  bottom: calc(92px + env(safe-area-inset-bottom));
}

.cluster-drawer-card {
  border: 1px solid rgba(20, 32, 26, 0.14);
  border-radius: 16px;
  background: rgba(255, 253, 247, 0.96);
  padding: 12px;
  box-shadow: 0 18px 48px rgba(20, 32, 26, 0.18);
}

.cluster-drawer-card h3 {
  margin: 0 0 8px;
}

.cluster-help {
  margin: -2px 0 10px;
  color: #536159;
  font-size: 0.9rem;
  font-weight: 700;
}

.cluster-chip-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.cluster-chip-row span {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #eef8fb;
  color: #16465c;
  padding: 7px 10px;
  font-size: 0.76rem;
  font-weight: 850;
}

.cluster-stop-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(190px, 1fr));
  gap: 8px;
  max-height: min(38svh, 300px);
  overflow: auto;
  padding-right: 2px;
}

.cluster-stop-card {
  display: grid;
  gap: 2px;
  align-content: start;
  min-width: 0;
  min-height: 132px;
  border: 1px solid rgba(20, 32, 26, 0.12);
  border-radius: 12px;
  background: #fffdf7;
  padding: 10px;
  text-align: left;
}

.cluster-stop-card strong {
  color: #14201a;
  font-size: 0.94rem;
  line-height: 1.12;
}

.cluster-stop-card small {
  color: #536159;
  font-size: 0.75rem;
  font-weight: 850;
}

.cluster-stop-card p {
  margin: 5px 0;
  color: #33423b;
  font-size: 0.82rem;
  line-height: 1.3;
}

.uploaded-stops-panel {
  position: fixed;
  z-index: 17;
  top: 156px;
  right: 16px;
  bottom: calc(92px + env(safe-area-inset-bottom));
  width: min(380px, calc(100vw - 32px));
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 8px;
  border: 1px solid rgba(20, 32, 26, 0.14);
  border-radius: 18px;
  background: rgba(255, 253, 247, 0.94);
  box-shadow: 0 22px 70px rgba(20, 32, 26, 0.18);
  padding: 12px;
  backdrop-filter: blur(16px);
}

.uploaded-stops-panel.is-map-fallback {
  left: 16px;
  width: auto;
}

.uploaded-stops-panel.is-collapsed {
  left: auto;
  bottom: auto;
  width: auto;
  grid-template-rows: auto;
}

.uploaded-stops-panel.is-collapsed .uploaded-category-row,
.uploaded-stops-panel.is-collapsed .uploaded-stop-list {
  display: none;
}

.uploaded-stops-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.uploaded-stops-head strong {
  display: block;
  color: #14201a;
}

.uploaded-stops-head small {
  display: block;
  color: #536159;
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1.25;
  margin-top: 2px;
}

.uploaded-category-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.uploaded-category-row span {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #eef8fb;
  color: #16465c;
  padding: 6px 9px;
  font-size: 0.72rem;
  font-weight: 850;
}

.uploaded-stop-list {
  display: grid;
  gap: 8px;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.uploaded-stop-card {
  display: grid;
  gap: 5px;
  align-content: start;
  border: 1px solid rgba(20, 32, 26, 0.12);
  border-radius: 12px;
  background: #fffdf7;
  padding: 9px;
}

.uploaded-stop-card > button {
  min-height: auto;
  display: grid;
  gap: 2px;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  box-shadow: none;
}

.uploaded-stop-card strong {
  color: #14201a;
  line-height: 1.12;
}

.uploaded-stop-card small {
  color: #536159;
  font-size: 0.74rem;
  font-weight: 850;
}

.uploaded-stop-card p {
  margin: 0;
  color: #33423b;
  font-size: 0.8rem;
  line-height: 1.28;
}

body[data-page="route"] .bottom-drawer,
body[data-page="explore"] .bottom-drawer {
  position: fixed;
  z-index: 20;
  left: 16px;
  right: 16px;
  bottom: calc(92px + env(safe-area-inset-bottom));
  max-height: min(52svh, 440px);
  overflow: auto;
  border: 1px solid rgba(20, 32, 26, 0.14);
  border-radius: 18px;
  background: rgba(255, 253, 247, 0.98);
  box-shadow: 0 22px 70px rgba(20, 32, 26, 0.22);
}

body[data-page="route"] .bottom-drawer:empty,
body[data-page="explore"] .bottom-drawer:empty {
  display: none;
}

body[data-page="route"] .stop-detail-card,
body[data-page="explore"] .stop-detail-card {
  grid-template-columns: 160px minmax(0, 1fr);
}

.badge-detail-head {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.badge-detail-head .badge-doodle-svg {
  width: 74px;
  height: 74px;
}

.badge-progress-line {
  height: 10px;
  border-radius: 999px;
  background: rgba(20, 32, 26, 0.12);
  overflow: hidden;
  margin: 12px 0;
}

.badge-progress-line span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #163f33, #1f78a4);
}

.badge-related-list {
  display: grid;
  gap: 8px;
  max-height: 42svh;
  overflow: auto;
}

.badge-related-list article {
  border: 1px solid rgba(20, 32, 26, 0.12);
  border-radius: 12px;
  padding: 10px;
  background: #fffdf7;
}

.badge-related-list small {
  display: block;
  color: #536159;
  font-weight: 750;
  margin: 2px 0 8px;
}

@media (max-width: 700px) {
  body[data-page="route"] .app-shell,
body[data-page="explore"] .app-shell {
    padding: 0;
  }

  body[data-page="route"] .topbar,
body[data-page="explore"] .topbar {
    top: max(8px, env(safe-area-inset-top));
    left: 10px;
    right: 10px;
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 46px;
    padding: 6px 8px;
    border-radius: 16px;
    margin-bottom: 0;
    gap: 6px;
  }

  body[data-page="route"] .topbar-meta,
body[data-page="explore"] .topbar-meta {
    display: none;
  }

  body[data-page="route"] .topbar h1,
  body[data-page="explore"] .topbar h1 {
    font-size: 1rem;
  }

  body[data-page="route"] #onlineStatus,
  body[data-page="explore"] #onlineStatus {
    display: none;
  }

  body[data-page="route"] .top-actions,
body[data-page="explore"] .top-actions {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 6px;
  }

  body[data-page="route"] .top-actions button,
body[data-page="explore"] .top-actions button,
  body[data-page="route"] .status-pill,
body[data-page="explore"] .status-pill {
    min-height: 32px;
    padding-inline: 9px;
    border-radius: 999px;
    font-size: 0.78rem;
  }

  body[data-page="route"] .traveler-chip,
  body[data-page="explore"] .traveler-chip {
    max-width: 118px;
  }

  .map-stage-head {
    inset: 62px 10px auto auto;
    width: auto;
    max-width: calc(100vw - 20px);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 6px;
    border-radius: 999px;
  }

  .map-stage-head .eyebrow,
  .map-stage-head h2 {
    display: none;
  }

  .map-stage-actions {
    gap: 6px;
  }

  .map-stage-actions button {
    min-height: 32px;
    padding-inline: 10px;
  }

  .map-stop-count {
    min-height: 32px;
    padding-inline: 10px;
    font-size: 0.78rem;
  }

  .uploaded-stops-panel {
    top: auto;
    left: 12px;
    right: 12px;
    bottom: calc(66px + env(safe-area-inset-bottom));
    width: auto;
    max-height: 28svh;
    padding: 10px;
    border-radius: 18px;
  }

  .uploaded-stops-panel:not(.is-collapsed) {
    grid-template-rows: auto minmax(92px, 1fr);
  }

  .uploaded-stops-panel.is-mobile-peek {
    max-height: 104px;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .uploaded-stops-panel.is-mobile-peek .uploaded-category-row {
    display: none;
  }

  .uploaded-stops-panel.is-mobile-peek .uploaded-stop-list {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(216px, 78vw);
    overflow-x: auto;
    overflow-y: hidden;
  }

  .uploaded-stops-panel.is-mobile-peek .uploaded-stop-card:nth-child(n + 4) {
    display: none;
  }

  .uploaded-stops-panel.is-mobile-peek .uploaded-stop-card p {
    display: none;
  }

  .uploaded-stops-panel.is-mobile-peek .uploaded-stop-card {
    min-height: 58px;
    padding: 8px 10px;
  }

  .uploaded-stops-panel.is-mobile-peek .uploaded-stop-card .compact-actions {
    display: none;
  }

  .uploaded-stops-head {
    align-items: center;
  }

  .uploaded-stops-head .eyebrow {
    display: none;
  }

  .uploaded-stops-head strong {
    font-size: 1rem;
  }

  .uploaded-stops-head small {
    font-size: 0.7rem;
  }

  .home-cluster-map,
  body[data-page="route"] .route-map-home,
body[data-page="explore"] .route-map-home,
  body[data-page="route"] .map-stage,
body[data-page="explore"] .map-stage {
    height: 100svh;
    min-height: 100svh;
  }

  .map-preview-card {
    bottom: calc(66px + env(safe-area-inset-bottom));
  }

  .attraction-preview-card {
    grid-template-columns: 92px minmax(0, 1fr);
    max-height: 34svh;
    overflow: auto;
  }

  body[data-page="route"] .bottom-drawer,
  body[data-page="explore"] .bottom-drawer,
  .cluster-drawer {
    left: 10px;
    right: 10px;
    bottom: calc(66px + env(safe-area-inset-bottom));
  }

  body[data-page="route"] .top-badge-preview,
  body[data-page="explore"] .top-badge-preview {
    left: 10px;
    right: 10px;
    bottom: max(6px, env(safe-area-inset-bottom));
    padding: 4px;
    border-radius: 14px;
  }

  .adventure-badge-tray {
    grid-auto-columns: 54px;
    max-height: 50px;
    gap: 5px;
  }

  .adventure-badge {
    height: 44px;
    min-height: 44px;
    grid-template-columns: 24px minmax(0, 1fr);
    padding: 3px;
    border-radius: 10px;
  }

  .adventure-badge .badge-doodle-svg {
    width: 24px;
    height: 24px;
  }

  .adventure-badge span {
    font-size: 0.58rem;
  }

  .adventure-badge small {
    font-size: 0.58rem;
  }

  .dom-map-cluster {
    width: 36px;
    height: 36px;
    min-height: 36px;
    border-width: 4px;
    font-size: 0.95rem;
  }

  .cluster-stop-grid {
    grid-template-columns: 1fr;
    max-height: 34svh;
  }

  body[data-page="route"] .stop-detail-card,
body[data-page="explore"] .stop-detail-card {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  .attraction-preview-card img {
    min-height: 94px;
  }
}
