:root {
  --paper: #f6f4f1;
  --stone: #e4ded2;
  --coral: #f95c4b;
  --coral-hover: #e14c3c;
  --black: #000000;
  --bg: var(--paper);
  --panel: var(--paper);
  --text: var(--black);
  --muted: #5c5854;
  --accent: var(--coral);
  --accent-hover: var(--coral-hover);
  --line: var(--stone);
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
  --radius-pill: 999px;
  --radius-card: 24px;
  --font: "Manrope", "Segoe UI", sans-serif;
  --panel-width: min(380px, calc(100vw - 24px));
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -40px;
  z-index: 30;
  background: var(--coral);
  color: var(--paper);
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  font-weight: 600;
}

.skip-link:focus {
  top: 8px;
}

.map-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
}

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

.site-header {
  position: absolute;
  z-index: 4;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 8px 8px 8px 18px;
  background: var(--paper);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow);
}

.site-header h1 {
  margin: 0;
  font-size: clamp(0.95rem, 2.6vw, 1.1rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.about-open,
.dialog-cta,
.dialog-close,
.detail-close {
  font-family: inherit;
  cursor: pointer;
}

.about-open,
.dialog-cta {
  min-height: 44px;
  min-width: 44px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--coral);
  color: var(--paper);
  padding: 8px 18px;
  font-size: 0.95rem;
  font-weight: 700;
}

.about-open:hover,
.dialog-cta:hover {
  background: var(--coral-hover);
}

.about-open:focus-visible,
.dialog-cta:focus-visible,
.dialog-close:focus-visible,
.detail-close:focus-visible,
.place-list button:focus-visible {
  outline: 3px solid var(--coral);
  outline-offset: 2px;
}

.map-status {
  display: none;
  position: absolute;
  z-index: 4;
  left: 12px;
  right: 12px;
  top: 76px;
  background: var(--stone);
  border-radius: 16px;
  padding: 10px 14px;
}

.map-status.is-visible {
  display: block;
}

.place-panel {
  position: absolute;
  z-index: 3;
  top: 76px;
  left: 12px;
  width: var(--panel-width);
  max-height: calc(100% - 88px);
  overflow: auto;
  background: var(--paper);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  padding: 16px 16px 12px;
}

.place-panel h2 {
  margin: 0 0 8px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.place-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.place-list li + li {
  border-top: 1px solid var(--stone);
}

.place-list button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 10px 4px;
  min-height: 44px;
  font: inherit;
  cursor: pointer;
  color: inherit;
}

.place-list button img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 12px;
  background: var(--stone);
  flex-shrink: 0;
}

.place-list button[aria-current="true"] {
  color: var(--coral);
  font-weight: 700;
}

.empty-note,
.credit {
  color: var(--muted);
  font-size: 0.9rem;
}

.detail {
  display: none;
}

.detail.is-open {
  display: block;
  padding-bottom: 8px;
}

.place-panel.is-detail .panel-list {
  display: none;
}

.detail-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.detail h3 {
  margin: 0 0 8px;
  font-size: 1.25rem;
  letter-spacing: -0.03em;
}

.detail-address {
  font-weight: 600;
  margin: 0 0 8px;
}

.detail-photo {
  margin: 0 0 12px;
}

.detail-photo img {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  display: block;
  background: var(--stone);
  border-radius: 16px;
}

.detail-photo .credit {
  margin: 6px 0 0;
  font-size: 0.8rem;
}

.detail-close {
  min-height: 44px;
  min-width: 44px;
  background: var(--stone);
  border: 0;
  border-radius: var(--radius-pill);
  padding: 0 16px;
  font-weight: 600;
}

.site-footer {
  flex: 0 0 auto;
  z-index: 5;
  padding: 8px 16px;
  background: var(--paper);
  border-top: 1px solid var(--stone);
}

.site-footer p {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--muted);
}

.site-footer a {
  color: var(--coral);
}

.maplibregl-ctrl-top-right {
  top: 76px;
  right: 12px;
}

#about-dialog {
  position: relative;
  width: min(32rem, calc(100vw - 24px));
  max-height: min(90dvh, 40rem);
  overflow: auto;
  border: 0;
  border-radius: 28px;
  padding: 32px 28px 24px;
  background: var(--paper);
  color: var(--text);
  box-shadow: var(--shadow);
}

#about-dialog::backdrop {
  background: rgba(0, 0, 0, 0.4);
}

#about-dialog h1 {
  margin: 0 1.75rem 12px 0;
  font-size: clamp(1.35rem, 4vw, 1.7rem);
  letter-spacing: -0.04em;
  font-weight: 700;
}

#about-dialog p {
  margin: 0 0 12px;
  line-height: 1.5;
}

.dialog-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--text);
  border-radius: var(--radius-pill);
}

.dialog-cta {
  width: 100%;
  margin-top: 8px;
}

.about-footer {
  color: var(--muted);
  font-size: 0.95rem;
}

@media (max-width: 800px) {
  .site-header {
    top: 8px;
    left: 8px;
    right: 8px;
    padding-left: 14px;
  }

  .place-panel {
    top: auto;
    left: 8px;
    right: 8px;
    bottom: 8px;
    width: auto;
    max-height: min(42dvh, calc(100% - 76px));
    border-radius: 24px;
  }

  .place-panel.is-detail {
    max-height: min(62dvh, calc(100% - 76px));
  }

  .place-panel.is-detail.has-photo {
    max-height: min(72dvh, calc(100% - 76px));
  }

  .map-status {
    left: 8px;
    right: 8px;
    top: 68px;
  }

  .maplibregl-ctrl-top-right {
    top: 68px;
    right: 8px;
  }
}

@media (max-width: 480px) {
  .about-open {
    padding: 8px 12px;
    font-size: 0.85rem;
  }

  .site-header h1 {
    font-size: 0.92rem;
  }
}
