:root {
  --bg: #fff7ed;
  --bg-strong: #7c2d12;
  --card: #fffbf5;
  --card-strong: #431407;
  --text: #2f2118;
  --muted: #7c6b5d;
  --accent: #c2410c;
  --accent-dark: #9a3412;
  --border: #ead7c3;
  --shadow: 0 22px 70px rgba(67, 20, 7, 0.16);
  --radius: 22px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(251, 191, 36, 0.28), transparent 32rem),
    linear-gradient(180deg, #fff7ed 0%, #fffaf3 52%, #f8efe4 100%);
  color: var(--text);
  min-height: 100vh;
}

button,
a {
  font: inherit;
}

a {
  color: var(--accent-dark);
}

button {
  color: inherit;
}

.hero {
  background:
    linear-gradient(135deg, rgba(67, 20, 7, 0.94), rgba(124, 45, 18, 0.88)),
    url("https://images.unsplash.com/photo-1601918774946-25832a4be0d6?auto=format&fit=crop&w=1600&q=80")
      center/cover;
  color: #fff7ed;
  padding: 1rem clamp(1rem, 3vw, 2rem) 3rem;
}

.topbar,
.hero__content,
.dashboard,
.content-grid,
.activity-section,
.sources {
  width: min(1240px, calc(100% - 2rem));
  margin-inline: auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0 2.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: inherit;
  text-decoration: none;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  background: #fbbf24;
  color: #431407;
  border-radius: 14px;
  font-weight: 900;
}

.brand small,
.pill,
.muted {
  color: rgba(255, 247, 237, 0.74);
}

.topbar__meta,
.hero__actions,
.controls,
.control-group,
.route-buttons,
.detail-actions,
.meta-row,
.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.pill {
  border: 1px solid rgba(255, 247, 237, 0.24);
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  background: rgba(255, 255, 255, 0.08);
}

.hero__content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: clamp(1.5rem, 5vw, 5rem);
  align-items: end;
}

.hero h1 {
  margin: 0;
  max-width: 820px;
  font-size: clamp(2.3rem, 6vw, 5rem);
  line-height: 0.95;
  letter-spacing: -0.06em;
}

.hero__lead {
  max-width: 760px;
  color: rgba(255, 247, 237, 0.82);
  font-size: clamp(1rem, 1.8vw, 1.25rem);
  line-height: 1.65;
}

.eyebrow {
  margin: 0 0 0.45rem;
  color: var(--accent);
  font-size: 0.77rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #fbbf24;
}

.hero-card,
.panel,
.map-shell,
.detail-panel,
.sources {
  background: rgba(255, 251, 245, 0.94);
  border: 1px solid rgba(234, 215, 195, 0.9);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-card {
  color: var(--text);
  padding: 1.25rem;
}

.hero-card h2,
.panel h2,
.detail-panel h2,
.section-heading h2,
.sources h2 {
  margin: 0;
  line-height: 1.12;
}

.compact-list,
.checklist,
.tip-list,
.detail-panel ul,
.sources ul {
  margin: 0;
  padding-left: 1.2rem;
}

.compact-list li,
.checklist li,
.detail-panel li,
.sources li {
  margin: 0.55rem 0;
}

.btn,
.chip {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 42px;
  border: 1px solid rgba(124, 45, 18, 0.2);
  border-radius: 999px;
  background: #fffaf3;
  color: var(--card-strong);
  text-decoration: none;
  padding: 0.62rem 1rem;
  cursor: pointer;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.btn:hover,
.chip:hover,
.route-card:hover,
.activity-card:hover,
.timeline-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(67, 20, 7, 0.12);
}

.btn--primary,
.chip--active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff7ed;
}

.dashboard {
  padding-top: 1.5rem;
}

.map-shell {
  padding: clamp(1rem, 2vw, 1.5rem);
  transform: translateY(-2rem);
}

.section-heading {
  margin-bottom: 1rem;
}

.section-heading p:not(.eyebrow) {
  max-width: 760px;
  color: var(--muted);
  line-height: 1.65;
}

.controls {
  justify-content: space-between;
  margin: 1rem 0;
}

.chip {
  min-height: 36px;
  padding: 0.45rem 0.75rem;
  font-size: 0.92rem;
}

.chip--legend span,
.legend__item span {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 999px;
  background: var(--dot);
  display: inline-block;
  margin-right: 0.45rem;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.8);
}

.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 1rem;
  align-items: start;
}

.map-panel {
  position: relative;
}

.map,
.map-fallback {
  min-height: 650px;
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  background: #e9ded3;
  z-index: 1;
}

.map-fallback {
  display: grid;
  place-items: center;
  padding: 2rem;
  text-align: center;
}

.legend {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  z-index: 500;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  max-width: min(520px, calc(100% - 2rem));
  padding: 0.75rem;
  border: 1px solid rgba(234, 215, 195, 0.9);
  border-radius: 16px;
  background: rgba(255, 251, 245, 0.94);
  box-shadow: 0 16px 32px rgba(67, 20, 7, 0.14);
}

.legend__item {
  display: inline-flex;
  align-items: center;
  font-size: 0.85rem;
  color: var(--card-strong);
}

.detail-panel {
  position: sticky;
  top: 1rem;
  min-height: 450px;
  padding: 1.25rem;
}

.detail-panel .muted {
  color: var(--muted);
}

.detail-panel p,
.tip-list p,
.sources p {
  color: var(--muted);
  line-height: 1.65;
}

.detail-panel h3 {
  margin: 1rem 0 0.35rem;
  font-size: 0.98rem;
}

.detail-title {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.meta-row {
  margin: 0.85rem 0;
}

.meta-row span {
  border-radius: 999px;
  background: #f5e6d3;
  color: #6b3d23;
  padding: 0.35rem 0.65rem;
  font-size: 0.84rem;
}

.address {
  border-left: 3px solid var(--accent);
  padding-left: 0.75rem;
}

.quick-links {
  margin-top: 1rem;
  flex-direction: column;
}

.route-toolbar {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1rem;
  align-items: start;
  margin-top: 1rem;
}

.route-toolbar h3 {
  margin: 0;
}

.route-card,
.activity-card__main,
.timeline-item {
  text-align: left;
  border: 1px solid var(--border);
  background: #fffaf3;
  color: var(--text);
  cursor: pointer;
}

.route-card {
  position: relative;
  display: grid;
  gap: 0.28rem;
  width: min(100%, 290px);
  border-radius: 18px;
  padding: 0.9rem 0.9rem 0.9rem 1.05rem;
}

.route-card__line {
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  border-radius: 18px 0 0 18px;
  background: var(--route);
}

.route-card small,
.route-card span:last-child,
.activity-card small {
  color: var(--muted);
}

.content-grid,
.activity-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 1rem;
  margin-top: 1rem;
}

.panel,
.sources {
  padding: 1.25rem;
}

.panel--wide {
  grid-row: span 2;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.timeline-day {
  display: grid;
  gap: 0.75rem;
}

.timeline-day h3 {
  margin: 0;
  color: var(--card-strong);
}

.timeline-item {
  display: grid;
  gap: 0.35rem;
  width: 100%;
  border-radius: 18px;
  padding: 0.9rem;
}

.timeline-item span {
  color: var(--accent-dark);
  font-size: 0.86rem;
  font-weight: 800;
}

.timeline-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.activity-section {
  grid-template-columns: 1fr;
  margin-bottom: 1rem;
}

.activity-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.activity-card {
  position: relative;
  min-height: 100%;
  border-radius: 20px;
}

.activity-card--selected {
  outline: 3px solid rgba(194, 65, 12, 0.24);
}

.activity-card__main {
  display: grid;
  gap: 0.6rem;
  width: 100%;
  height: 100%;
  border-radius: 20px;
  padding: 1rem;
}

.activity-card h3 {
  margin: 0;
  padding-right: 2rem;
}

.activity-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.tag {
  justify-self: start;
  border-radius: 999px;
  background: color-mix(in srgb, var(--tag-color), white 82%);
  color: #431407;
  padding: 0.3rem 0.58rem;
  font-size: 0.78rem;
  font-weight: 800;
}

.favorite {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(124, 45, 18, 0.18);
  border-radius: 999px;
  background: #fff7ed;
  color: var(--accent-dark);
  cursor: pointer;
  font-size: 1.2rem;
}

.favorite--detail {
  position: static;
}

.custom-marker {
  background: transparent;
  border: 0;
}

.custom-marker span {
  display: block;
  width: 26px;
  height: 26px;
  border: 3px solid #fffaf3;
  border-radius: 999px 999px 999px 0;
  background: var(--marker-color);
  box-shadow: 0 7px 18px rgba(67, 20, 7, 0.35);
  transform: rotate(-45deg);
}

.popup-link {
  margin-top: 0.4rem;
  border: 0;
  background: transparent;
  color: var(--accent-dark);
  padding: 0;
  cursor: pointer;
  font-weight: 700;
}

.leaflet-popup-content {
  color: var(--text);
}

.empty-state {
  grid-column: 1 / -1;
  border: 1px dashed var(--border);
  border-radius: 18px;
  padding: 2rem;
  text-align: center;
  color: var(--muted);
}

.sources {
  margin-top: 1rem;
  margin-bottom: 2rem;
}

@media (max-width: 1050px) {
  .hero__content,
  .map-layout,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .detail-panel {
    position: static;
  }

  .timeline,
  .activity-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .route-toolbar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero {
    padding-bottom: 2rem;
  }

  .hero h1 {
    letter-spacing: -0.04em;
  }

  .map {
    min-height: 520px;
  }

  .legend {
    position: static;
    margin-top: 0.75rem;
    max-width: 100%;
  }

  .timeline,
  .activity-list {
    grid-template-columns: 1fr;
  }

  .route-card {
    width: 100%;
  }
}

@media print {
  .hero {
    background: #fff;
    color: #111;
    padding-bottom: 1rem;
  }

  .topbar__meta,
  .hero__actions,
  .controls,
  .map-panel,
  .route-toolbar,
  .favorite {
    display: none !important;
  }

  .map-shell,
  .panel,
  .detail-panel,
  .sources {
    box-shadow: none;
    break-inside: avoid;
  }

  .content-grid,
  .timeline,
  .activity-list {
    grid-template-columns: 1fr;
  }
}
