:root {
  color-scheme: light;
  --ink: #17232b;
  --muted: #5f6f76;
  --panel: #fffdf7;
  --line: #d9e2e2;
  --teal: #0f766e;
  --teal-dark: #12343b;
  --gold: #f4b63f;
  --shadow: 0 16px 38px rgba(18, 52, 59, 0.18);
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  background: #e8f1ef;
  color: var(--ink);
}

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

button {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.app-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 18px clamp(16px, 3vw, 30px);
  background: var(--teal-dark);
  color: white;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--gold);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(2rem, 5vw, 4.2rem);
  line-height: 0.96;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 10px;
  font-size: 1.45rem;
  line-height: 1.08;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0;
}

.lede {
  max-width: 42rem;
  margin-bottom: 0;
  color: #d8f3ee;
  font-size: 1rem;
}

.header-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.header-links a {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: var(--radius);
  color: white;
  font-size: 0.86rem;
  font-weight: 800;
  text-decoration: none;
}

.map-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
}

.map-panel {
  position: relative;
  min-height: 580px;
}

#map {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.status {
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 500;
  max-width: min(520px, calc(100% - 32px));
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(18, 52, 59, 0.18);
  border-radius: var(--radius);
  background: rgba(255, 253, 247, 0.94);
  box-shadow: var(--shadow);
  color: var(--teal-dark);
  font-size: 0.9rem;
  font-weight: 800;
}

.info-panel {
  max-height: calc(100vh - 128px);
  overflow: auto;
  border-left: 1px solid var(--line);
  background: var(--panel);
}

.hero-image {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 11;
  object-fit: cover;
  border-bottom: 1px solid var(--line);
}

.panel-body {
  padding: 18px;
}

.callout {
  margin-bottom: 18px;
  padding: 12px;
  border-left: 4px solid var(--teal);
  background: #eef8f6;
  color: #244147;
  font-size: 0.95rem;
  line-height: 1.4;
}

.legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 22px;
}

.legend-item {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  font-size: 0.84rem;
  font-weight: 800;
}

.legend-icon,
.location-button__icon {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--marker-color);
  color: white;
}

.legend-icon svg,
.location-button__icon svg {
  width: 17px;
  height: 17px;
}

.location-list {
  display: grid;
  gap: 8px;
}

.location-button {
  width: 100%;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 64px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.location-button:hover,
.location-button:focus-visible {
  border-color: var(--teal);
  outline: 3px solid rgba(20, 184, 166, 0.22);
}

.location-button strong,
.location-button small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.location-button strong {
  margin-bottom: 3px;
  font-size: 0.94rem;
}

.location-button small {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.map-marker {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 3px solid white;
  border-radius: 50% 50% 50% 0;
  background: var(--marker-color);
  box-shadow: 0 8px 18px rgba(23, 35, 43, 0.34);
  color: white;
  transform: rotate(-45deg);
}

.map-marker__icon {
  display: grid;
  place-items: center;
  transform: rotate(45deg);
}

.map-marker svg {
  width: 21px;
  height: 21px;
}

.location-label {
  padding: 4px 7px;
  border: 1px solid rgba(23, 35, 43, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 4px 12px rgba(23, 35, 43, 0.18);
  color: #17232b;
  font-size: 0.72rem;
  font-weight: 900;
}

.leaflet-tooltip-left.location-label::before,
.leaflet-tooltip-right.location-label::before {
  display: none;
}

.location-popup .leaflet-popup-content-wrapper {
  overflow: hidden;
  border-radius: var(--radius);
}

.location-popup .leaflet-popup-content {
  width: 260px !important;
  margin: 0;
}

.popup-card {
  background: white;
}

.popup-card__image {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: block;
  object-fit: cover;
}

.popup-card__category,
.popup-card__title,
.popup-card__address {
  margin-left: 12px;
  margin-right: 12px;
}

.popup-card__category {
  margin-top: 12px;
  margin-bottom: 4px;
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.popup-card__title {
  margin-bottom: 6px;
  font-size: 1.08rem;
}

.popup-card__address {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.popup-card__sticker,
.popup-card__maps {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 12px;
  color: white;
  font-weight: 900;
  text-decoration: none;
}

.popup-card__sticker {
  background: #f97316;
}

.popup-card__maps {
  background: var(--teal-dark);
}

@media (max-width: 880px) {
  .app-header {
    align-items: start;
    flex-direction: column;
  }

  .header-links {
    justify-content: start;
  }

  .map-layout {
    grid-template-columns: 1fr;
  }

  .map-panel {
    min-height: 62vh;
  }

  .info-panel {
    max-height: none;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .hero-image {
    aspect-ratio: 16 / 9;
  }
}

@media (max-width: 520px) {
  .app-header {
    padding: 14px;
  }

  .map-panel {
    min-height: 58vh;
  }

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

  .location-label {
    display: none;
  }
}
