:root {
  --bg: #f2ede4;
  --panel: rgba(253, 250, 246, 0.92);
  --ink: #202017;
  --muted: #5f5f4f;
  --accent: #c44f2b;
  --accent-soft: #efd4ca;
  --stroke: rgba(50, 38, 24, 0.2);
  --shadow: 0 18px 50px rgba(36, 22, 8, 0.18);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: radial-gradient(circle at 10% 0%, #fbf7f1 0%, #efe7da 50%, #eadfcf 100%);
  color: var(--ink);
  font-family: "Space Grotesk", sans-serif;
}

.app-shell {
  display: grid;
  grid-template-columns: 1fr minmax(280px, 360px);
  gap: 14px;
  height: 100dvh;
  padding: 14px;
}

.map-wrap {
  position: relative;
  border: 1px solid var(--stroke);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #ddd;
}

#map {
  width: 100%;
  height: 100%;
}

.map-title {
  position: absolute;
  top: 14px;
  left: 14px;
  right: auto;
  max-width: min(82%, 460px);
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(252, 246, 238, 0.86);
  backdrop-filter: blur(6px);
  text-align: left;
}

.map-title h1 {
  margin: 0;
  font-family: "Fraunces", serif;
  letter-spacing: 0.01em;
  font-size: clamp(1.1rem, 2.2vw, 1.7rem);
}

.map-title p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.panel {
  border: 1px solid var(--stroke);
  border-radius: 22px;
  background: var(--panel);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  padding: 14px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.panel-header h2 {
  margin: 0;
  font-family: "Fraunces", serif;
  font-size: 1.25rem;
}

.panel-header p {
  margin: 6px 0 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.place-list {
  margin: 0;
  padding: 0;
  list-style: none;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.place-item {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: #fffaf4;
  padding: 10px;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

.place-item:hover,
.place-item:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(181, 68, 34, 0.6);
  background: #fff4ec;
}

.place-name {
  font-weight: 600;
  margin: 0;
  font-size: 0.96rem;
}

.place-meta {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.maplibregl-popup-content {
  border-radius: 12px;
  border: 1px solid var(--stroke);
  padding: 12px;
  min-width: 210px;
}

.popup-title {
  margin: 0;
  font-family: "Fraunces", serif;
  font-size: 1rem;
}

.popup-dates {
  margin: 8px 0;
  padding-left: 16px;
  max-height: 140px;
  overflow: auto;
}

.popup-link {
  display: inline-block;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  margin-top: 3px;
}

.popup-link:hover {
  text-decoration: underline;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
    gap: 10px;
    padding: 10px;
  }

  .map-wrap {
    min-height: 60dvh;
  }

  .panel {
    max-height: 34dvh;
    border-radius: 16px;
  }
}
