* {
  box-sizing: border-box;
}

:root {
  --ink: #20201d;
  --muted: #74736b;
  --paper: #f5f1e8;
  --surface: #fffdf8;
  --line: #ded8cc;
  --accent: #bd5d3a;
  --accent-dark: #8d3e24;
  --shadow: 0 18px 50px rgba(39, 32, 22, 0.16);
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.is-hidden {
  display: none !important;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 7px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.topbar h1,
.dialog-article h2 {
  margin: 0;
  font-family: "Playfair Display", serif;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.primary-button {
  color: white;
  background: var(--accent);
}

.primary-button:hover {
  background: var(--accent-dark);
}

.app {
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 104px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.topbar h1 {
  font-size: clamp(24px, 3vw, 39px);
}

.topbar-subtitle {
  max-width: 560px;
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.secondary-button {
  border: 1px solid var(--line);
  color: var(--ink);
  background: transparent;
}

.layout {
  display: grid;
  grid-template-columns: 390px minmax(0, 1fr);
  height: calc(100vh - 105px);
}

.sidebar {
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.route-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--line);
}

.route-summary div {
  padding: 14px 8px;
  text-align: center;
  background: var(--paper);
}

.route-summary strong,
.route-summary span {
  display: block;
}

.route-summary strong {
  font-size: 15px;
}

.route-summary span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.points-list {
  padding: 0 10px 24px;
}

.point-button {
  display: grid;
  width: 100%;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  padding: 13px 10px;
  border: 0;
  border-radius: 15px;
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.point-button:hover,
.point-button.is-active {
  background: var(--paper);
}

.point-letter {
  display: grid;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  place-items: center;
  color: white;
  font-weight: 800;
  background: var(--accent);
}

.point-button strong,
.point-button small {
  display: block;
}

.point-button strong {
  margin-top: 1px;
  font-size: 14px;
}

.point-button small {
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

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

.leaflet-container {
  font: inherit;
  background: #ddd7cb;
}

.map-hint {
  position: absolute;
  z-index: 1;
  top: 16px;
  left: 50%;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 50px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  background: rgba(255, 253, 248, 0.92);
  box-shadow: 0 8px 24px rgba(39, 32, 22, 0.15);
  transform: translateX(-50%);
  backdrop-filter: blur(10px);
}

.place-dialog {
  width: min(760px, calc(100% - 30px));
  max-height: min(88vh, 900px);
  padding: 0;
  overflow-y: auto;
  overflow-x: hidden;
  border: 0;
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.place-dialog::backdrop {
  background: rgba(23, 21, 18, 0.58);
  backdrop-filter: blur(4px);
}

.dialog-close {
  position: absolute;
  z-index: 3;
  top: 12px;
  right: 12px;
  display: grid;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  place-items: center;
  color: var(--ink);
  font-size: 25px;
  background: rgba(255, 253, 248, 0.9);
  cursor: pointer;
}

.place-image {
  display: block;
  width: 100%;
  height: 240px;
  object-fit: contain;
  object-position: center;
  background: var(--line);
}

.dialog-article {
  padding: 30px 34px 36px;
}

.dialog-article h2 {
  margin-bottom: 8px;
  font-size: clamp(30px, 5vw, 48px);
  line-height: 1.03;
}

.place-meta {
  margin: 0 0 23px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.place-timing {
  margin: -10px 0 22px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.dialog-article p {
  color: #4e4c46;
  font-size: 15px;
  line-height: 1.75;
}

.fact-box {
  margin-top: 22px;
  padding: 18px 20px;
  border-left: 4px solid var(--accent);
  border-radius: 0 14px 14px 0;
  background: var(--paper);
}

.fact-box strong {
  display: block;
  margin-bottom: 6px;
}

.place-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 25px;
}

.place-actions a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border-radius: 11px;
  color: white;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  background: var(--accent);
}

.place-actions a:nth-child(2) {
  background: #3e4f67;
}

.intro-dialog {
  overflow-y: auto;
}

.intro-dialog .dialog-article {
  padding-top: 45px;
}

.intro-dialog h2:not(:first-of-type) {
  margin-top: 34px;
}

.gm-style-iw-chr {
  position: absolute;
  z-index: 2;
  top: 0;
  right: 0;
}

.map-info {
  max-width: 210px;
  padding: 8px 2px 4px;
}

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

.map-info strong {
  font-family: "Playfair Display", serif;
  font-size: 18px;
}

.map-info span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

@media (max-width: 900px) {
  .topbar {
    align-items: flex-start;
    gap: 14px;
  }

  .topbar-actions {
    flex-direction: column;
  }

  .layout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(45vh, 1fr) auto;
    height: calc(100vh - 105px);
  }

  .map-section {
    grid-row: 1;
  }

  .sidebar {
    grid-row: 2;
    overflow-x: auto;
    overflow-y: hidden;
    border-top: 1px solid var(--line);
    border-right: 0;
  }

  .route-summary {
    display: none;
  }

  .points-list {
    display: flex;
    width: max-content;
    padding: 10px;
  }

  .point-button {
    width: 210px;
  }
}

@media (max-width: 620px) {
  .topbar {
    min-height: 142px;
    padding: 14px 16px;
  }

  .topbar-actions {
    flex-shrink: 0;
  }

  .topbar-actions .secondary-button {
    display: none;
  }

  .primary-button {
    min-height: 42px;
    padding: 0 12px;
    font-size: 11px;
  }

  .layout {
    height: calc(100vh - 143px);
  }

  .place-dialog {
    width: min(100% - 16px, 560px);
    max-height: calc(100vh - 16px);
    margin: 8px;
  }

  .place-image {
    height: 180px;
    padding: 8px;
  }

  .dialog-article {
    padding: 24px 22px 30px;
  }

  .map-hint {
    width: max-content;
    max-width: calc(100% - 20px);
  }
}

.custom-map-marker {
  display: grid;
  width: 34px;
  height: 34px;
  border: 3px solid #fffdf8;
  border-radius: 50%;
  place-items: center;
  color: white;
  font-size: 13px;
  font-weight: 800;
  background: #bd5d3a;
  box-shadow: 0 6px 16px rgba(39, 32, 22, 0.28);
  cursor: pointer;
}
