:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  color: #1f2a27;
  background: #dfe9df;
  font-synthesis: none;
  --glass: rgba(247, 251, 249, 0.78);
  --glass-strong: rgba(249, 252, 251, 0.88);
  --glass-control: rgba(255, 255, 255, 0.42);
  --glass-control-hover: rgba(255, 255, 255, 0.68);
  --glass-edge: rgba(255, 255, 255, 0.82);
  --glass-edge-soft: rgba(255, 255, 255, 0.52);
  --glass-highlight: rgba(255, 255, 255, 0.76);
  --line: rgba(48, 62, 57, 0.12);
  --muted: #60706a;
  --accent: #007aff;
  --accent-pressed: #006ee6;
  --accent-soft: rgba(0, 122, 255, 0.11);
  --shadow: 0 18px 46px rgba(30, 48, 42, 0.17), 0 3px 12px rgba(30, 48, 42, 0.09), inset 0 1px 0 var(--glass-highlight);
  --shadow-control: 0 5px 14px rgba(31, 48, 43, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.72);
  --radius-panel: 24px;
  --radius-control: 14px;
  --glass-filter: blur(16px) saturate(145%);
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  min-height: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  position: fixed;
  inset: 0;
  width: 100%;
  min-height: 0;
  height: auto;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(0, 122, 255, 0.32);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

#app {
  position: absolute;
  inset: 0;
  width: 100%;
  min-height: 0;
  height: auto;
  isolation: isolate;
  overflow: clip;
  background: #dfe9df;
}

#map {
  position: absolute;
  inset: 0;
  background: #c9e1ea;
}

.map-header {
  position: absolute;
  z-index: 12;
  display: flex;
  align-items: center;
}

.map-header::after,
.schedule-panel::after,
.layers-panel::after,
.place-detail::after,
.map-error::after {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.3), transparent 27%, transparent 72%, rgba(255, 255, 255, 0.16));
  pointer-events: none;
}

.map-header > *,
.schedule-panel > *,
.layers-panel > *,
.place-detail > *,
.map-error > * {
  position: relative;
  z-index: 1;
}

.header-command,
.state-toggle {
  min-height: 40px;
  border: 1px solid var(--glass-edge-soft);
  border-radius: var(--radius-control);
  background: var(--glass-control);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.58);
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease, transform 110ms ease;
}

.header-command {
  padding: 0 15px;
  font-weight: 650;
}

.icon-command {
  width: 40px;
  min-width: 40px;
  padding: 0;
}

.icon-command svg {
  width: 18px;
  height: 18px;
  display: block;
  margin: 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.schedule-menu-button {
  width: 40px;
  min-width: 40px;
  padding: 0;
}

.schedule-menu-icon {
  display: grid;
  width: 16px;
  gap: 3px;
  margin: 0 auto;
}

.schedule-menu-icon span {
  width: 16px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.header-command:hover,
.state-toggle:hover {
  border-color: var(--glass-edge);
  background: var(--glass-control-hover);
  box-shadow: var(--shadow-control);
}

.header-command:active,
.state-toggle:active {
  transform: scale(0.96);
}

.state-toggle {
  width: 40px;
  min-width: 40px;
  padding: 0;
  color: inherit;
  font-size: 12px;
  font-weight: 550;
  white-space: nowrap;
}

.schedule-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.schedule-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 15px 12px;
  border-bottom: 1px solid var(--line);
}

.schedule-head > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.schedule-head strong {
  font-size: 15px;
  font-weight: 600;
}

.schedule-head span {
  color: var(--muted);
  font-size: 11px;
}

.schedule-list {
  min-height: 0;
  padding: 5px 6px 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

.schedule-list::-webkit-scrollbar {
  display: none;
}

.day-button {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 10px;
  padding: 11px 10px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, box-shadow 140ms ease, transform 110ms ease;
}

.day-button:hover {
  border-color: rgba(255, 255, 255, 0.48);
  background: rgba(255, 255, 255, 0.42);
}

.day-button.active {
  border-color: rgba(0, 122, 255, 0.16);
  background: linear-gradient(135deg, rgba(0, 122, 255, 0.14), rgba(0, 122, 255, 0.07));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.52);
}

.day-button.active::before {
  display: none;
}

.day-button:active {
  transform: scale(0.985);
}

.day-key {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.day-key strong {
  font-size: 13px;
  font-weight: 700;
}

.day-key span {
  color: var(--muted);
  font-size: 10px;
}

.day-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.day-route {
  color: #24302d;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
}

.day-hotel {
  overflow: hidden;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.day-hotel {
  color: #52625c;
}

.day-button.high .day-key strong::after {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-left: 5px;
  border-radius: 50%;
  background: #d87938;
  vertical-align: 2px;
}

.layers-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.layers-head strong {
  font-size: 14px;
  font-weight: 600;
}

.layer-group {
  padding: 10px 10px 12px;
  border-bottom: 1px solid var(--line);
}

.layer-group:last-child {
  border-bottom: 0;
}

.layer-group-title {
  display: block;
  margin: 0 6px 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

.layer-group label {
  min-height: 38px;
  display: grid;
  grid-template-columns: 18px 20px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 0 6px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.25;
  cursor: pointer;
  transition: background-color 140ms ease;
}

.layer-group label:hover {
  background: rgba(255, 255, 255, 0.38);
}

.layer-group input {
  margin: 0;
  appearance: none;
  cursor: pointer;
  transition: background-color 130ms ease, border-color 130ms ease, box-shadow 130ms ease, transform 110ms ease;
}

.layer-group input:checked {
  border-color: var(--accent);
  background-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M4.3 9.3 7.4 12.2 13.8 5.8' fill='none' stroke='white' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  box-shadow: 0 2px 5px rgba(0, 122, 255, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.layer-group input:active {
  transform: scale(0.9);
}

.swatch {
  width: 16px;
  height: 11px;
  display: block;
  border-radius: 2px;
}

.swatch-building { background: #c8cbc1; border: 1px solid #aeb2a7; }
.swatch-road { height: 4px; background: #fff; box-shadow: 0 0 0 1px #bfc6c1; }
.swatch-label { background: linear-gradient(#56625e 0 2px, transparent 2px 5px, #56625e 5px 7px, transparent 7px); }
.swatch-terrain { background: linear-gradient(135deg, #9fc996 0 48%, #ead29b 52% 100%); }
.swatch-poi { width: 10px; height: 10px; margin-left: 3px; border-radius: 50%; background: #5e8b6b; }
.swatch-route { height: 4px; background: #1673e6; box-shadow: 0 0 0 1px rgba(255,255,255,.8); }
.swatch-stay { width: 11px; height: 11px; margin-left: 2px; border-radius: 3px; background: #f47a38; }
.swatch-sight { width: 11px; height: 11px; margin-left: 2px; border-radius: 50%; background: #2e9d6f; }
.swatch-landmark { width: 11px; height: 11px; margin-left: 2px; transform: rotate(45deg); background: #495b57; }
.swatch-shopping { background: #7e69b5; }
.swatch-fuel { background: #d38a36; }
.swatch-food { background: #c9534d; }

.poi-category + .poi-category {
  border-top: 1px solid rgba(54, 70, 64, 0.08);
}

.poi-category-row {
  min-height: 40px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18px;
  align-items: center;
  gap: 8px;
  padding: 0 6px;
}

.poi-category-name {
  min-width: 0;
  min-height: 38px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 10px;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
}

.poi-category-name > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.poi-category-chevron {
  width: 7px;
  height: 7px;
  border-right: 1.5px solid #63716c;
  border-bottom: 1.5px solid #63716c;
  transform: rotate(-45deg);
  transition: transform 150ms ease;
}

.poi-category-name[aria-expanded="true"] .poi-category-chevron {
  transform: rotate(45deg) translate(-1px, -1px);
}

.layer-group .poi-category-switch {
  min-height: 18px;
  display: block;
  padding: 0;
  border-radius: 0;
}

.layer-group .poi-category-switch:hover {
  background: transparent;
}

.brand-filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1px;
  margin: 0 6px 7px 24px;
  padding: 5px 0 6px;
  border-top: 1px solid rgba(54, 70, 64, 0.09);
}

.brand-filters[hidden] {
  display: none;
}

.layer-group .brand-filters label {
  min-height: 34px;
  grid-template-columns: minmax(0, 1fr) 18px;
  gap: 7px;
  padding: 0 4px 0 8px;
  color: #4d5c57;
  font-size: 10.5px;
}

.layer-group .brand-filters label > input {
  grid-column: 2;
  grid-row: 1;
}

.layer-group .brand-filters label > span {
  grid-column: 1;
  grid-row: 1;
}

.layer-group input:indeterminate {
  border-color: var(--accent);
  background-color: var(--accent);
  background-image: linear-gradient(white, white);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 8px 2px;
}

.map-source-note {
  margin: 0;
  padding: 10px 15px 12px;
  border-top: 1px solid var(--line);
  color: #687771;
  font-size: 9px;
  line-height: 1.4;
}

.map-source-note a {
  color: inherit;
  text-decoration: none;
}

.map-source-note a:hover {
  text-decoration: underline;
}

.place-detail > .detail-head > span,
.place-detail > .detail-head > strong,
.place-detail > .place-detail-copy {
  display: block;
}

.place-detail > .detail-head > span {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

.place-detail > .detail-head > strong {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.place-detail-copy {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.place-detail-copy p {
  margin: 0;
}

.place-detail-copy p + p {
  margin-top: 8px;
}

.place-detail-copy .place-description {
  text-align: justify;
}

.place-detail-media {
  width: 100%;
  margin: 9px auto 10px;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(67, 86, 77, 0.14);
  border-radius: 14px;
  background: rgba(233, 242, 237, 0.82);
  box-shadow: 0 6px 15px rgba(37, 57, 48, 0.09);
}

.place-detail-media.is-photo {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.place-detail-media.is-icon {
  padding: 8px;
}

.place-detail-image {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  background: transparent;
}

.place-detail-media.is-photo .place-detail-image {
  max-width: 100%;
  border: 1px solid rgba(67, 86, 77, 0.2);
  border-radius: 14px;
  background: transparent;
  box-shadow: 0 6px 15px rgba(37, 57, 48, 0.09);
}

.place-detail-media.is-photo.is-landscape .place-detail-image {
  width: 100%;
  height: auto;
  margin: 0;
}

.place-detail-media.is-photo.is-portrait {
  width: fit-content;
  max-width: 100%;
  margin-inline: auto;
}

.place-detail-media.is-photo.is-portrait .place-detail-image {
  width: auto;
  height: auto;
  max-height: min(650px, calc(100dvh - 210px));
  margin: 0 auto;
}

.place-detail-media.is-icon .place-detail-image {
  aspect-ratio: 1 / 1;
  object-fit: contain;
}

.place-detail-media figcaption {
  padding: 5px 8px 6px;
  color: #6b7a73;
  font-size: 10px;
  line-height: 1.35;
}

.place-detail-media figcaption a {
  color: inherit;
  text-decoration: none;
}

.place-detail-media figcaption a:hover {
  color: #3d6656;
  text-decoration: underline;
}

.place-meta {
  padding-left: 9px;
  border-left: 2px solid rgba(242, 124, 56, 0.72);
  color: #52625c;
}

.place-address {
  overflow-wrap: anywhere;
}

.place-detail.is-stay .detail-head {
  border-bottom: 0;
}

.place-detail.is-stay .detail-head > span {
  margin-bottom: 4px;
}

.place-detail.is-stay .place-detail-copy {
  margin-top: 4px;
}

.place-detail.is-stay .place-detail-copy p + p {
  margin-top: 4px;
}

.place-detail.is-stay .place-meta {
  padding-left: 0;
  border-left: 0;
}

.map-error {
  position: absolute;
  z-index: 30;
  top: 50%;
  left: 50%;
  width: min(360px, calc(100vw - 32px));
  padding: 18px;
  overflow: hidden;
  border: 1px solid var(--glass-edge);
  border-radius: 22px;
  background: var(--glass-strong);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: var(--glass-filter);
  backdrop-filter: var(--glass-filter);
  transform: translate(-50%, -50%);
  text-align: center;
}

.map-error strong,
.map-error span {
  display: block;
}

.map-error span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.maplibregl-popup-content {
  padding: 11px 13px;
  border: 1px solid var(--glass-edge);
  border-radius: 16px;
  background: var(--glass-strong);
  color: #24302d;
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
}

@media (max-width: 760px) {
  .map-header {
    top: auto;
    right: auto;
    bottom: calc(env(safe-area-inset-bottom) + 10px);
    left: 50%;
    max-width: calc(100vw - 16px - env(safe-area-inset-left) - env(safe-area-inset-right));
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0;
    padding: 6px;
    overflow: visible;
    border: 1px solid rgba(255, 255, 255, 0.68);
    border-radius: 32px;
    background:
      linear-gradient(135deg, rgba(255, 255, 255, 0.4), rgba(232, 247, 250, 0.16) 46%, rgba(210, 239, 247, 0.28)),
      rgba(232, 243, 246, 0.3);
    background-clip: padding-box;
    box-shadow:
      0 12px 34px rgba(18, 42, 48, 0.18),
      0 2px 8px rgba(26, 54, 60, 0.1),
      inset 0 1px 1px rgba(255, 255, 255, 0.9),
      inset 0 -1px 1px rgba(72, 107, 116, 0.16);
    -webkit-backdrop-filter: blur(26px) saturate(190%) contrast(108%) brightness(1.04);
    backdrop-filter: blur(26px) saturate(190%) contrast(108%) brightness(1.04);
    transform: translateX(-50%);
    transition: opacity 160ms ease, transform 180ms ease;
    pointer-events: auto;
  }

  .map-header::after {
    display: block;
    inset: 1px;
    border-radius: 31px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.66), rgba(255, 255, 255, 0.06) 31%, rgba(116, 210, 232, 0.08) 68%, rgba(255, 255, 255, 0.34));
    box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.54);
    opacity: 0.72;
  }

  .map-header > * {
    pointer-events: auto;
  }

  .header-command,
  .state-toggle {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    width: 52px;
    min-width: 52px;
    height: 52px;
    min-height: 52px;
    padding: 0;
    border: 0;
    border-radius: 26px;
    background: transparent;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    font-size: 11px;
  }

  .header-command:hover,
  .header-command:active,
  .state-toggle:hover,
  .state-toggle:active {
    border-radius: 26px;
    background: transparent;
    box-shadow: none;
  }

  .icon-command svg {
    width: 22px;
    height: 22px;
  }

  #reset-button {
    color: var(--accent);
  }

  .maplibregl-ctrl-bottom-right {
    display: none;
  }
}

html.standalone body,
html.standalone #app {
  background: #c9e1ea;
}

@media (display-mode: standalone) {
  body,
  #app {
    background: #c9e1ea;
  }
}

@media (max-width: 350px) {
  .map-header {
    padding: 4px;
  }
}

@media (hover: none) {
  .header-command:hover,
  .state-toggle:hover,
  .day-button:hover,
  .layer-group label:hover {
    box-shadow: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .map-header,
  .schedule-panel,
  .layers-panel,
  .place-detail,
  .map-error,
  .maplibregl-popup-content {
    background-color: rgba(249, 252, 251, 0.96);
  }
}

@media (prefers-contrast: more) {
  :root {
    --glass: rgba(252, 253, 252, 0.94);
    --glass-strong: rgba(255, 255, 255, 0.98);
    --line: rgba(34, 47, 42, 0.22);
    --muted: #46534e;
  }
}

/* Shared sheet behavior: one surface, one dismissal model. */
.surface-backdrop {
  position: absolute;
  z-index: 10;
  inset: 0;
  display: none;
  padding: 0;
  border: 0;
  background: rgba(19, 35, 39, 0.04);
  visibility: hidden;
  pointer-events: none;
}

.ios-sheet {
  --sheet-radius: clamp(28px, 7vw, 34px);
}

.layers-scroll {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

.place-detail-copy {
  scrollbar-width: none;
}

.layers-scroll::-webkit-scrollbar,
.place-detail-copy::-webkit-scrollbar {
  display: none;
}

.schedule-head,
.layers-head,
.detail-head {
  position: relative;
}

@media (max-width: 760px) {
  #app.surface-open .map-header,
  #app.surface-open .maplibregl-control-container {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }

  .surface-backdrop {
    display: block;
  }

  .surface-backdrop:not([hidden]) {
    visibility: visible;
    pointer-events: auto;
  }

  .ios-sheet {
    position: fixed;
    z-index: 21;
    top: auto;
    right: max(8px, env(safe-area-inset-right));
    bottom: max(8px, env(safe-area-inset-bottom));
    left: max(8px, env(safe-area-inset-left));
    width: auto;
    max-width: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 0.5px solid rgba(255, 255, 255, 0.78);
    border-radius: var(--sheet-radius);
    background: rgba(244, 249, 250, 0.62);
    box-shadow:
      0 18px 50px rgba(18, 38, 44, 0.18),
      inset 0 1px 0 rgba(255, 255, 255, 0.82);
    -webkit-backdrop-filter: blur(30px) saturate(180%) brightness(1.04);
    backdrop-filter: blur(30px) saturate(180%) brightness(1.04);
    transform: translate3d(0, calc(100% + max(8px, env(safe-area-inset-bottom)) + 12px), 0);
    visibility: hidden;
    pointer-events: none;
    transition: transform 190ms cubic-bezier(0.22, 0.78, 0.26, 1), visibility 0s linear 190ms;
    will-change: transform;
  }

  .ios-sheet.is-open {
    transform: translate3d(0, 0, 0);
    visibility: visible;
    pointer-events: auto;
    transition: transform 190ms cubic-bezier(0.22, 0.78, 0.26, 1), visibility 0s linear 0s;
  }

  .ios-sheet.is-dragging {
    transform: translate3d(0, var(--sheet-drag-y, 0px), 0);
    transition: none;
  }

  @supports (corner-shape: squircle) {
    .ios-sheet {
      corner-shape: squircle;
    }
  }

  .schedule-panel {
    height: min(60dvh, 600px);
    max-height: min(60dvh, 600px);
    border-radius: var(--sheet-radius);
    background: rgba(244, 249, 250, 0.62);
  }

  .schedule-head {
    min-height: 58px;
    display: flex;
    align-items: center;
    gap: 0;
    padding: 8px 15px 8px 9px;
    border-bottom: 0.5px solid rgba(65, 83, 77, 0.12);
  }

  .schedule-head > div {
    flex: 1;
  }

  .schedule-list {
    min-height: 0;
    flex: 1;
    padding: 4px 8px max(10px, env(safe-area-inset-bottom));
    touch-action: pan-y;
  }

  .layers-panel {
    top: auto;
    height: min(72dvh, 640px);
    max-height: min(72dvh, 640px);
    padding: 0;
    border-radius: var(--sheet-radius);
    background: rgba(244, 249, 250, 0.62);
  }

  .layers-head {
    min-height: 58px;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 15px;
    border-bottom: 0.5px solid rgba(65, 83, 77, 0.12);
    background: transparent;
  }

  .layers-head strong {
    flex: 1;
    font-size: 16px;
  }

  .layers-scroll {
    flex: 1;
    overflow-y: auto;
    padding-bottom: max(6px, env(safe-area-inset-bottom));
  }

  .layer-group {
    padding: 11px 12px 12px;
  }

  .layer-group-title {
    margin: 0 8px 5px;
    font-size: 11px;
    letter-spacing: 0.01em;
  }

  .layer-group label {
    min-height: 48px;
    grid-template-columns: 20px minmax(0, 1fr) 51px;
    gap: 9px;
    padding: 0 8px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.25;
  }

  .layer-group label > input {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    order: 3;
  }

  .layer-group label > .swatch {
    grid-column: 1;
    grid-row: 1;
    order: 1;
  }

  .layer-group label > span {
    grid-column: 2;
    grid-row: 1;
    order: 2;
  }

  .layer-group input {
    position: relative;
    width: 51px;
    height: 31px;
    border: 0;
    border-radius: 999px;
    background: rgba(92, 106, 101, 0.24);
    box-shadow: inset 0 0 0 0.5px rgba(41, 57, 52, 0.15), inset 0 1px 2px rgba(35, 48, 44, 0.12);
    transition: background-color 140ms ease, box-shadow 140ms ease;
  }

  .layer-group input::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 27px;
    height: 27px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 2px 5px rgba(32, 47, 42, 0.18), inset 0 0.5px 0 rgba(255, 255, 255, 0.9);
    transition: transform 140ms cubic-bezier(0.22, 0.78, 0.26, 1);
  }

  .layer-group input:checked {
    border: 0;
    background: #34c759;
    background-image: none;
    box-shadow: inset 0 0 0 0.5px rgba(17, 108, 45, 0.18), 0 1px 2px rgba(32, 105, 48, 0.18);
  }

  .layer-group input:checked::after {
    transform: translateX(20px);
  }

  .poi-category-row {
    min-height: 50px;
    grid-template-columns: minmax(0, 1fr) 51px;
    gap: 9px;
    padding: 0 8px;
  }

  .poi-category-name {
    min-height: 48px;
    grid-template-columns: 20px minmax(0, 1fr) 12px;
    gap: 9px;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.25;
  }

  .layer-group .poi-category-switch {
    width: 51px;
    height: 31px;
  }

  .brand-filters {
    gap: 1px;
    margin: 0 8px 7px 30px;
    padding: 5px 0 7px;
  }

  .layer-group .brand-filters label {
    min-height: 44px;
    grid-template-columns: minmax(0, 1fr) 51px;
    gap: 9px;
    padding: 0 0 0 8px;
    font-size: 12px;
  }

  .layer-group .brand-filters label > input {
    grid-column: 2;
    grid-row: 1;
  }

  .layer-group .brand-filters label > span {
    grid-column: 1;
    grid-row: 1;
  }

  .layer-group input:indeterminate {
    border: 0;
    background: #77c98a;
    background-image: none;
    box-shadow: inset 0 0 0 0.5px rgba(17, 108, 45, 0.14), 0 1px 2px rgba(32, 105, 48, 0.12);
  }

  .layer-group input:indeterminate::after {
    transform: translateX(10px);
  }

  .map-source-note {
    padding: 12px 20px max(14px, env(safe-area-inset-bottom));
    font-size: 10px;
  }

  .place-detail {
    height: auto;
    max-height: min(82dvh, 760px);
    padding: 0;
    border-radius: var(--sheet-radius);
    background: rgba(244, 249, 250, 0.62);
  }

  .detail-head {
    flex: none;
    padding: 14px 15px 10px;
    border-bottom: 0.5px solid rgba(65, 83, 77, 0.12);
  }

  .detail-head > span,
  .detail-head > strong {
    display: block;
  }

  .detail-head > span {
    margin-top: 2px;
    margin-bottom: 4px;
  }

  .detail-head > strong {
    font-size: 17px;
  }

  .place-detail-copy {
    min-height: 0;
    flex: 0 1 auto;
    max-height: calc(min(82dvh, 760px) - 82px);
    margin: 0;
    padding: 0 15px max(18px, env(safe-area-inset-bottom));
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    font-size: 13.5px;
    line-height: 1.58;
  }

  .place-detail.is-stay .place-detail-copy {
    padding: 6px 15px 14px;
  }

  .place-detail-media {
    width: 100%;
    margin: 12px auto 14px;
    border-radius: 18px;
    box-shadow: none;
  }

  .place-detail-media.is-photo .place-detail-image {
    border-radius: 18px;
  }

  .place-detail-media.is-photo.is-portrait .place-detail-image {
    max-height: min(650px, calc(min(82dvh, 760px) - 150px));
  }

  .place-detail-media figcaption {
    padding: 7px 11px 8px;
    font-size: 10.5px;
  }

}

@media (min-width: 761px) {
  .surface-backdrop {
    display: block;
  }

  .surface-backdrop:not([hidden]) {
    visibility: visible;
    pointer-events: auto;
  }

  .map-header {
    position: fixed;
    top: max(12px, env(safe-area-inset-top));
    right: auto;
    left: 50%;
    min-height: 52px;
    justify-content: flex-start;
    gap: 4px;
    padding: 5px;
    overflow: visible;
    border: 0.5px solid rgba(255, 255, 255, 0.82);
    border-radius: 18px;
    background:
      linear-gradient(145deg, rgba(255, 255, 255, 0.5), rgba(238, 248, 246, 0.18) 46%, rgba(255, 255, 255, 0.26)),
      rgba(240, 247, 246, 0.7);
    box-shadow:
      0 12px 34px rgba(22, 39, 35, 0.17),
      0 2px 8px rgba(28, 45, 40, 0.08),
      inset 0 1px 0 rgba(255, 255, 255, 0.9);
    -webkit-backdrop-filter: blur(28px) saturate(170%) brightness(1.03);
    backdrop-filter: blur(28px) saturate(170%) brightness(1.03);
    transform: translateX(-50%);
  }

  .schedule-menu-button,
  .icon-command,
  .state-toggle {
    width: 42px;
    min-width: 42px;
    height: 42px;
    min-height: 42px;
    padding: 0;
    border: 0;
    border-radius: 13px;
    background: transparent;
    box-shadow: none;
  }

  .schedule-menu-button:hover,
  .icon-command:hover,
  .state-toggle:hover {
    border: 0;
    background: rgba(255, 255, 255, 0.5);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  }

  .state-toggle {
    font-size: 11px;
  }

  .ios-sheet {
    border: 0.5px solid rgba(255, 255, 255, 0.82);
    border-radius: 18px;
    background:
      linear-gradient(145deg, rgba(255, 255, 255, 0.44), transparent 48%),
      rgba(243, 249, 247, 0.76);
    box-shadow:
      0 18px 48px rgba(23, 40, 35, 0.2),
      0 3px 10px rgba(28, 46, 40, 0.08),
      inset 0 1px 0 rgba(255, 255, 255, 0.86);
    -webkit-backdrop-filter: blur(28px) saturate(165%) brightness(1.02);
    backdrop-filter: blur(28px) saturate(165%) brightness(1.02);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 160ms ease, transform 180ms cubic-bezier(0.22, 0.78, 0.26, 1), visibility 0s linear 180ms;
  }

  .ios-sheet.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 160ms ease, transform 180ms cubic-bezier(0.22, 0.78, 0.26, 1), visibility 0s linear 0s;
  }

  .schedule-panel {
    position: fixed;
    z-index: 21;
    top: 78px;
    bottom: 14px;
    left: 14px;
    width: min(370px, calc(100vw - 28px));
    transform: translate3d(-10px, 0, 0) scale(0.99);
  }

  .schedule-panel.is-open {
    transform: translate3d(0, 0, 0) scale(1);
  }

  .schedule-head {
    min-height: 56px;
    padding: 10px 14px;
    border-bottom: 0.5px solid rgba(53, 69, 63, 0.13);
  }

  .layers-panel {
    position: fixed;
    z-index: 21;
    top: 78px;
    right: 14px;
    width: min(370px, calc(100vw - 28px));
    height: min(680px, calc(100dvh - 92px));
    max-height: calc(100dvh - 92px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translate3d(10px, -4px, 0) scale(0.99);
  }

  .layers-panel.is-open {
    transform: translate3d(0, 0, 0) scale(1);
  }

  .layers-head {
    position: relative;
    flex: none;
    min-height: 52px;
    padding: 10px 14px;
    border-bottom: 0.5px solid rgba(53, 69, 63, 0.13);
    background: transparent;
  }

  .layers-scroll {
    min-height: 0;
    flex: 1;
    overflow-y: auto;
  }

  .layer-group > label {
    grid-template-columns: 18px minmax(0, 1fr) 36px;
    gap: 8px;
  }

  .layer-group > label > input {
    grid-column: 3;
    grid-row: 1;
  }

  .layer-group > label > .swatch {
    grid-column: 1;
    grid-row: 1;
  }

  .layer-group > label > span {
    grid-column: 2;
    grid-row: 1;
  }

  .layer-group input {
    position: relative;
    width: 36px;
    height: 22px;
    border: 0;
    border-radius: 999px;
    background: rgba(83, 99, 93, 0.24);
    background-image: none;
    box-shadow: inset 0 0 0 0.5px rgba(36, 52, 46, 0.18), inset 0 1px 2px rgba(34, 48, 43, 0.08);
  }

  .layer-group input::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 1px 4px rgba(29, 44, 39, 0.22);
    transition: transform 140ms cubic-bezier(0.22, 0.78, 0.26, 1);
  }

  .layer-group input:checked {
    border: 0;
    background: #34c759;
    background-image: none;
  }

  .layer-group input:checked::after {
    transform: translateX(14px);
  }

  .layer-group input:indeterminate {
    border: 0;
    background: #7acb8d;
    background-image: none;
  }

  .layer-group input:indeterminate::after {
    transform: translateX(7px);
  }

  .poi-category-row {
    grid-template-columns: minmax(0, 1fr) 36px;
  }

  .layer-group .poi-category-switch {
    width: 36px;
    height: 22px;
  }

  .layer-group .brand-filters label {
    grid-template-columns: minmax(0, 1fr) 36px;
    font-size: 11px;
  }

  .place-detail {
    position: fixed;
    z-index: 21;
    right: 14px;
    bottom: 14px;
    width: min(clamp(420px, 34vw, 480px), calc(100vw - 28px));
    max-height: calc(100dvh - 92px);
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    transform: translate3d(10px, 8px, 0) scale(0.99);
  }

  .place-detail.is-open {
    transform: translate3d(0, 0, 0) scale(1);
  }

  .detail-head {
    display: block;
    flex: none;
    padding: 16px 18px 12px;
    border-bottom: 0.5px solid rgba(53, 69, 63, 0.13);
  }

  .detail-head > span,
  .detail-head > strong {
    display: block;
  }

  .detail-head > strong {
    font-size: 16px;
  }

  .place-detail-copy {
    min-height: 0;
    flex: 0 1 auto;
    margin: 0;
    padding: 2px 18px 18px;
    overflow-y: auto;
    font-size: 13px;
    line-height: 1.55;
  }

  .place-detail.is-stay .place-detail-copy {
    padding-top: 8px;
    padding-bottom: 16px;
  }
}

/* Lodging cards retain their existing type scale, with an even five-row rhythm. */
.place-detail.is-stay .detail-head {
  padding-bottom: 0;
}

.place-detail.is-stay .detail-head > span,
.place-detail.is-stay .detail-head > strong,
.place-detail.is-stay .place-detail-copy {
  line-height: 19px;
}

.place-detail.is-stay .detail-head > span {
  margin-bottom: 4px;
}

.place-detail.is-stay .place-detail-copy {
  margin-top: 4px;
  padding-top: 0;
}

.place-detail.is-stay .place-detail-copy p + p {
  margin-top: 4px;
}

.place-detail.is-stay .place-hotel {
  font-weight: 600;
  overflow-wrap: anywhere;
}
