:root {
  --bg: #0f1419;
  --panel: rgba(18, 24, 32, 0.92);
  --panel-border: rgba(255, 232, 214, 0.12);
  --ink: #f6efe6;
  --muted: #b7aea3;
  --soft: #8d8479;
  --accent: #e8a0a0;
  --accent-2: #7eb8c9;
  --card: rgba(255, 255, 255, 0.04);
  --card-hover: rgba(255, 255, 255, 0.08);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --radius: 18px;
  --font: "Manrope", system-ui, sans-serif;
  --serif: "Cormorant Garamond", Georgia, serif;
}

* {
  box-sizing: border-box;
}

.hidden {
  display: none !important;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
}

body {
  overflow: hidden;
}

.app {
  display: grid;
  grid-template-columns: minmax(300px, 380px) 1fr;
  height: 100%;
}

.panel {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px 20px 16px;
  background:
    radial-gradient(1200px 500px at -10% -20%, rgba(232, 160, 160, 0.16), transparent 55%),
    radial-gradient(900px 400px at 120% 10%, rgba(126, 184, 201, 0.12), transparent 50%),
    var(--panel);
  border-right: 1px solid var(--panel-border);
  backdrop-filter: blur(16px);
  overflow: auto;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(232, 160, 160, 0.14);
  color: #ffd4d4;
  font-size: 0.78rem;
  font-weight: 600;
}

.chip.soft {
  background: rgba(126, 184, 201, 0.14);
  color: #c9e7ef;
}

.section {
  background: var(--card);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 14px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.section h2 {
  margin: 0 0 10px;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--soft);
  font-weight: 700;
}

.layer-details summary {
  list-style: none;
  cursor: default;
}

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

.layer-details summary h2 {
  margin: 0;
}

.layer-details summary::after {
  display: none;
}

.section-head h2 {
  margin: 0;
}

.ghost {
  border: 1px solid var(--panel-border);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 5px 10px;
  font: inherit;
  font-size: 0.72rem;
  cursor: pointer;
}

.ghost:hover {
  color: var(--ink);
  border-color: rgba(255, 232, 214, 0.28);
}

.stops {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  counter-reset: stop;
}

.stop {
  counter-increment: stop;
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: inherit;
  transition: 0.18s ease;
}

.stop:hover,
.stop.active {
  background: var(--card-hover);
  border-color: var(--panel-border);
}

.stop::before {
  content: counter(stop);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(232, 160, 160, 0.16);
  color: #ffd4d4;
  font-size: 0.75rem;
  font-weight: 700;
  margin-top: 2px;
}

.stop-name {
  font-weight: 650;
  font-size: 0.95rem;
}

.stop-ja {
  color: var(--accent-2);
  font-size: 0.78rem;
  margin-top: 2px;
}

.stop-meta {
  color: var(--soft);
  font-size: 0.75rem;
  margin-top: 4px;
}

.stop-blurb {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
  margin-top: 6px;
}

.toggles {
  display: grid;
  gap: 8px;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  cursor: pointer;
}

.toggle input {
  accent-color: var(--accent);
}

.swatch {
  width: 12px;
  height: 12px;
  border-radius: 4px;
}

.swatch.route {
  background: linear-gradient(90deg, #60a5fa, #f97316);
}
.swatch.cities {
  background: repeating-linear-gradient(
    135deg,
    #e11d48 0 3px,
    #f59e0b 3px 6px,
    #8b5cf6 6px 9px,
    #10b981 9px 12px
  );
}
.swatch.poi {
  background: #e8a0a0;
}
.swatch.hotel {
  background: #f5d78e;
}
.swatch.photo {
  background: #7dd3fc;
}

.legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
  color: var(--soft);
  font-size: 0.75rem;
}

.poi-cats {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--panel-border);
}

.cat-pill {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  color: #1a1410;
  border: 1.5px solid #fff8f0;
  vertical-align: middle;
  margin-right: 4px;
  flex: 0 0 auto;
}

.cat-pill svg {
  width: 11px;
  height: 11px;
  display: block;
}

.cat-pill.food {
  background: #f59e0b;
}
.cat-pill.nature {
  background: #34d399;
}
.cat-pill.temple {
  background: #c4b5fd;
}
.cat-pill.other {
  background: #e8a0a0;
}
.cat-pill.hotel {
  background: #f5d78e;
}
.cat-pill.photo {
  background: #7dd3fc;
}

.legend div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lg {
  width: 18px;
  height: 3px;
  border-radius: 999px;
  display: inline-block;
}

.lg.transit {
  background: #60a5fa;
}
.lg.shuttle {
  background: repeating-linear-gradient(
    90deg,
    #e8b86d 0 5px,
    transparent 5px 9px
  );
  height: 3px;
}
.lg.walk {
  background: repeating-linear-gradient(
    90deg,
    #34d399 0 4px,
    transparent 4px 9px
  );
  height: 3px;
}
.lg.hike {
  background: repeating-linear-gradient(
    90deg,
    #f97316 0 4px,
    transparent 4px 9px
  );
  height: 3px;
}
.lg.drive {
  background: #a78bfa;
}
.lg.air {
  background: repeating-linear-gradient(
    90deg,
    #38bdf8 0 10px,
    transparent 10px 16px
  );
  height: 3px;
}

.lg-bus {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #2a4a6e;
  border: 1.5px solid #d6e8ff;
  display: inline-block;
  position: relative;
  margin-left: 2px;
}

.lg-bus::after {
  content: "";
  position: absolute;
  inset: 3px 4px 4px;
  border: 1.5px solid #9ec8ff;
  border-radius: 2px;
}

.lg-shuttle {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #5c4520;
  border: 1.5px solid #f5e0b8;
  display: inline-block;
  margin-left: 2px;
}

.lg-air {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #0c4a6e;
  border: 1.5px solid #bae6fd;
  display: inline-block;
  margin-left: 2px;
  position: relative;
}

.lg-air::before {
  content: "";
  position: absolute;
  left: 3px;
  right: 3px;
  top: 6px;
  height: 1.5px;
  background: #7dd3fc;
  border-radius: 1px;
}

.lg-air::after {
  content: "";
  position: absolute;
  left: 5px;
  right: 5px;
  top: 3px;
  bottom: 3px;
  border-left: 1.5px solid #7dd3fc;
  border-right: 1.5px solid #7dd3fc;
  transform: skewX(-24deg);
}

.bus-marker {
  background: transparent;
  border: 0;
}

.bus-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #2a4a6e;
  color: #9ec8ff;
  border: 2px solid #d6e8ff;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.bus-badge svg {
  width: 15px;
  height: 15px;
  display: block;
}

.shuttle-badge {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #5c4520;
  color: #f5e0b8;
  border: 2px solid #f0d5a0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.shuttle-badge svg {
  width: 12px;
  height: 12px;
  display: block;
}

.air-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #0c4a6e;
  color: #7dd3fc;
  border: 2px solid #bae6fd;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.air-badge svg {
  width: 15px;
  height: 15px;
  display: block;
}

.days {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  overflow: auto;
}

.day {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.day:hover,
.day.active {
  background: var(--card-hover);
  border-color: var(--panel-border);
}

.day-date {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.day-title {
  font-size: 0.82rem;
  line-height: 1.35;
}

.day-sub {
  color: var(--soft);
  font-size: 0.72rem;
  margin-top: 2px;
}

.foot {
  margin-top: auto;
  color: var(--soft);
  font-size: 0.7rem;
  padding: 4px 2px 2px;
}

.map-wrap {
  position: relative;
  min-width: 0;
}

#map {
  width: 100%;
  height: 100%;
  background: #0b1a24;
}

.menu-btn {
  display: none;
  position: fixed;
  z-index: 1200;
  top: calc(14px + env(safe-area-inset-top, 0px));
  left: calc(14px + env(safe-area-inset-left, 0px));
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: rgba(18, 24, 32, 0.92);
  color: var(--ink);
  box-shadow: var(--shadow);
  cursor: pointer;
  font-size: 1.15rem;
  -webkit-tap-highlight-color: transparent;
}

.app.panel-open .menu-btn {
  left: auto;
  right: calc(14px + env(safe-area-inset-right, 0px));
  font-size: 1.35rem;
  background: rgba(18, 24, 32, 0.96);
}

.panel-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1090;
  border: 0;
  padding: 0;
  background: rgba(6, 10, 14, 0.55);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.panel-close {
  display: none;
  position: absolute;
  top: calc(12px + env(safe-area-inset-top, 0px));
  right: 12px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 1.45rem;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.panel-close:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.12);
}

.leaflet-container {
  font-family: var(--font);
  background: #0b1a24;
}

/* City boundaries: soft hover — fill fades out, dashed stroke brightens */
.leaflet-cities-pane path.city-poly {
  transition:
    fill-opacity 0.45s ease,
    stroke-opacity 0.45s ease,
    stroke-width 0.45s ease;
}

/* Closer zoom: fill disappears (stroke stays) */
.leaflet-cities-pane.cities-zoomed-in path.city-poly {
  fill-opacity: 0 !important;
}

.leaflet-cities-pane path.city-poly.is-active {
  fill-opacity: 0 !important;
  stroke-opacity: 0.95 !important;
  stroke-width: 2.05px !important;
}

.leaflet-cities-pane path.city-poly.is-dim {
  fill-opacity: 0.04 !important;
  stroke-opacity: 0.4 !important;
  stroke-width: 1.1px !important;
}

.leaflet-cities-pane.cities-zoomed-in path.city-poly.is-dim {
  fill-opacity: 0 !important;
}

.leaflet-cities-pane path.city-poly.is-hover {
  fill-opacity: 0 !important;
  stroke-opacity: 1 !important;
  stroke-width: 2.15px !important;
}

.leaflet-popup-content-wrapper {
  background: #161d26;
  color: var(--ink);
  border-radius: 14px;
  box-shadow: var(--shadow);
  border: 1px solid var(--panel-border);
}

.leaflet-popup-tip {
  background: #161d26;
}

.leaflet-popup-content {
  margin: 12px 14px;
  font-size: 0.88rem;
  line-height: 1.4;
}

.popup-kicker {
  color: var(--accent);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 4px;
}

.popup-title {
  font-family: var(--serif);
  font-size: 1.25rem;
  margin: 0 0 4px;
}

.popup-meta {
  color: var(--muted);
  font-size: 0.8rem;
}

.popup-review {
  margin: 8px 0 0;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 232, 214, 0.16);
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
  font-style: italic;
}

.popup-maps {
  margin: 8px 0 0;
  font-size: 0.82rem;
}

.popup-maps a {
  color: #8ec8ff;
  text-decoration: none;
}

.popup-maps a:hover {
  text-decoration: underline;
}

.popup-photo-link {
  display: block;
  margin-top: 8px;
  border-radius: 10px;
  overflow: hidden;
  line-height: 0;
}

.popup-photo {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  display: block;
}

.photo-marker {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 2px solid #fff8f0;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  background: #0b1a24;
}

.photo-marker img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-cluster-wrap {
  background: transparent;
  border: 0;
}

.photo-cluster-icon {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(12, 22, 32, 0.88);
  border: 2px solid #fff8f0;
  box-shadow:
    0 0 0 3px rgba(0, 0, 0, 0.32),
    0 0 0 6px rgba(125, 211, 252, 0.28);
  color: #dff4ff;
  font-weight: 700;
  font-size: 0.82rem;
  line-height: 1;
}

.photo-cluster-popup .leaflet-popup-content {
  margin: 10px 12px 12px;
}

.photo-cluster-gallery .popup-kicker {
  margin-bottom: 8px;
}

.photo-cluster-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: min(52vh, 360px);
  overflow: auto;
  padding-right: 2px;
}

.photo-cluster-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: inherit;
  font: inherit;
}

.photo-cluster-thumb {
  display: block;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 1;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 232, 214, 0.14);
}

.photo-cluster-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-cluster-fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: 72px;
  color: #7dd3fc;
  font-size: 1.4rem;
  font-weight: 700;
}

.photo-cluster-caption {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.photo-cluster-caption strong {
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.photo-cluster-caption em {
  font-size: 0.68rem;
  color: var(--muted);
  font-style: normal;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.popup-photo-desc {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.photo-cluster-item:hover .photo-cluster-thumb {
  border-color: rgba(125, 211, 252, 0.55);
  box-shadow: 0 0 0 2px rgba(125, 211, 252, 0.18);
}

.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
  background: transparent;
}

.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
  background: transparent;
}

body.photo-viewer-open {
  overflow: hidden;
}

.photo-viewer {
  position: fixed;
  inset: 0;
  z-index: 15000;
  display: grid;
  place-items: center;
  padding: 16px;
}

.photo-viewer.hidden,
.photo-viewer[hidden] {
  display: none !important;
}

.photo-viewer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 10, 14, 0.82);
  backdrop-filter: blur(6px);
}

.photo-viewer-dialog {
  position: relative;
  z-index: 1;
  width: min(960px, 100%);
  max-height: min(92vh, 900px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(255, 232, 214, 0.14);
  background:
    radial-gradient(900px 420px at 0% 0%, rgba(125, 211, 252, 0.1), transparent 55%),
    rgba(14, 20, 28, 0.96);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

.photo-viewer-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.photo-viewer-close:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.12);
}

.photo-viewer-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: var(--ink);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.photo-viewer-nav:hover {
  background: rgba(255, 255, 255, 0.16);
}

.photo-viewer-prev {
  left: 10px;
}

.photo-viewer-next {
  right: 10px;
}

.photo-viewer-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 240px);
  gap: 14px;
  align-items: start;
  padding-top: 8px;
}

.photo-viewer-img {
  width: 100%;
  max-height: min(68vh, 620px);
  object-fit: contain;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.35);
}

.photo-viewer-info {
  min-width: 0;
  padding-right: 28px;
}

.photo-viewer-info .popup-title {
  margin: 4px 0 8px;
}

.photo-viewer-review {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.photo-viewer-maps {
  margin: 10px 0 0;
  font-size: 0.82rem;
}

.photo-viewer-maps a {
  color: #8ec8ff;
  text-decoration: none;
}

.photo-viewer-maps a:hover {
  text-decoration: underline;
}

.photo-viewer-counter {
  margin: 12px 0 0;
  color: var(--soft);
  font-size: 0.78rem;
}

.photo-viewer-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 2px;
}

.photo-viewer-thumb {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.28);
  cursor: pointer;
}

.photo-viewer-thumb img,
.photo-viewer-thumb span {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: grid;
  place-items: center;
  color: #7dd3fc;
  font-weight: 700;
}

.photo-viewer-thumb.active {
  border-color: #7dd3fc;
  box-shadow: 0 0 0 2px rgba(125, 211, 252, 0.22);
}

@media (max-width: 720px) {
  .photo-viewer-main {
    grid-template-columns: 1fr;
  }

  .photo-viewer-info {
    padding-right: 0;
  }

  .photo-viewer-nav {
    width: 36px;
    height: 36px;
    font-size: 1.35rem;
  }
}

.marker-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #fff8f0;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.28);
  background: var(--cat, #e8a0a0);
  display: grid;
  place-items: center;
  color: #1a1410;
  line-height: 1;
}

.marker-dot svg {
  width: 15px;
  height: 15px;
  display: block;
}

.marker-dot.cat-hotel {
  border-radius: 9px;
}

@media (max-width: 860px) {
  html,
  body {
    height: 100%;
    overflow: hidden;
  }

  .app {
    grid-template-columns: 1fr;
    height: 100dvh;
    position: relative;
    overflow: hidden;
  }

  .app.panel-open .panel-backdrop {
    display: block;
  }

  .panel {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1100;
    width: min(86vw, 340px);
    max-width: 100%;
    height: 100dvh;
    padding:
      calc(18px + env(safe-area-inset-top, 0px))
      16px
      calc(16px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-105%);
    transition: transform 0.25s ease;
    box-shadow: var(--shadow);
    border-right: 1px solid var(--panel-border);
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .panel.open {
    transform: translateX(0);
  }

  .panel-close {
    display: grid;
    place-items: center;
  }

  .menu-btn {
    display: grid;
    place-items: center;
  }

  .map-wrap {
    height: 100dvh;
    min-height: 0;
  }

  #map {
    touch-action: pan-x pan-y pinch-zoom;
  }

  .leaflet-top.leaflet-right {
    top: calc(10px + env(safe-area-inset-top, 0px));
    right: calc(10px + env(safe-area-inset-right, 0px));
  }

  .leaflet-control-zoom a {
    width: 36px;
    height: 36px;
    line-height: 36px;
    font-size: 1.15rem;
  }

  .leaflet-popup-content-wrapper {
    max-width: calc(100vw - 40px);
  }

  .leaflet-popup-content {
    margin: 10px 12px;
    font-size: 0.84rem;
    max-height: min(52vh, 360px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .popup-title {
    font-size: 1.1rem;
  }

  .photo-cluster-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: min(46vh, 300px);
  }

  .days {
    max-height: none;
  }

  .stop,
  .day {
    min-height: 44px;
  }

  .layer-details summary {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 0;
  }

  .layer-details summary h2 {
    margin: 0;
  }

  .layer-details summary::after {
    display: block;
    content: "▾";
    color: var(--soft);
    font-size: 0.85rem;
    transition: transform 0.2s ease;
  }

  .layer-details[open] summary::after {
    transform: rotate(180deg);
  }

  .layer-details[open] summary {
    margin-bottom: 10px;
  }

  .layer-details .toggles {
    margin-top: 2px;
  }

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

  .photo-viewer {
    padding:
      calc(8px + env(safe-area-inset-top, 0px))
      8px
      calc(8px + env(safe-area-inset-bottom, 0px));
  }

  .photo-viewer-dialog {
    max-height: calc(100dvh - 16px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    padding: 12px;
  }

  .photo-viewer-nav {
    width: 40px;
    height: 40px;
  }

  .photo-viewer-prev {
    left: 4px;
  }

  .photo-viewer-next {
    right: 4px;
  }
}

@media (min-width: 861px) {
  .layer-details > summary {
    pointer-events: none;
  }

  .layer-details > summary::after {
    display: none;
  }
}
