:root {
  --paper: #faf8f5;
  --sand: #f4f1ec;
  --sage: #e2eae0;
  --line: #e9e5de;
  --ink: #2c332b;
  --muted: #5f665e;
  --forest: #5a6e58;
  --clay: #c67d5a;
  --white: #ffffff;
  --display: "Cormorant Garamond", Palatino, serif;
  --sans: "DM Sans", ui-sans-serif, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body.v2 {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  min-height: 100vh;
  padding-bottom: 72px;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
button, [role="button"], a { cursor: pointer; }
button { font: inherit; }

.eyebrow {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--clay);
}

.app-header {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 64px;
  padding: 8px 16px;
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(250, 248, 245, 0.94);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.brand { text-decoration: none; color: inherit; flex: none; display: flex; align-items: center; gap: 8px; }
.brand-mark { width: 28px; height: 28px; }
.brand strong {
  display: block;
  font-family: var(--display);
  font-size: 24px;
  font-weight: 500;
  line-height: 1;
}
.brand small {
  display: block;
  margin-top: 1px;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.search-slim {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 4px 4px 12px;
}
.search-slim select, .search-slim input {
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 14px;
  outline: none;
  color: var(--ink);
}
.search-slim input { flex: 1; min-width: 80px; }
.search-slim select { max-width: 130px; }
.desktop-nav { display: flex; gap: 16px; }
.desktop-nav a { color: var(--ink); text-decoration: none; font-size: 13px; font-weight: 600; }

.btn-ink, .btn-ghost, .btn-forest {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  min-height: 40px;
}
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-forest { background: var(--forest); color: var(--paper); }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }

.more-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-items: end;
  padding: 12px 16px 14px;
  background: var(--sand);
  border-bottom: 1px solid var(--line);
}
.more-filters[hidden] { display: none !important; }
.more-filters label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.more-filters select {
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 999px;
  padding: 8px 12px;
  font: inherit;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink);
}
.money-card { margin: 0; font-size: 12px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; }

.hero {
  position: relative;
  min-height: 280px;
  overflow: hidden;
  color: var(--paper);
}
.hero-media, .hero-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(44, 51, 43, 0.72), rgba(44, 51, 43, 0.2) 55%, rgba(44, 51, 43, 0.15));
}
.hero-content {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 48px 20px 28px;
}
.hero h1 {
  font-family: var(--display);
  font-size: clamp(36px, 6vw, 64px);
  line-height: 0.92;
  font-weight: 500;
  margin: 0;
  text-wrap: balance;
}
.motto {
  font-family: var(--display);
  font-style: italic;
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.3;
  max-width: 640px;
  margin: 12px 0 0;
}
#heroHint { margin: 10px 0 0; max-width: 520px; color: rgba(250,248,245,.88); font-size: 14px; }

.hero-pills, .view-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.chip {
  border: 1px solid rgba(250, 248, 245, 0.4);
  background: rgba(44, 51, 43, 0.35);
  color: #faf8f5;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
}
.chip.is-active { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.chip span { margin-left: 6px; opacity: 0.7; }
.view-tools .chip {
  background: var(--sand);
  color: var(--ink);
  border-color: var(--line);
}
.view-tools .chip.is-active { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.section { padding: 36px 0 48px; }
.section.sand { background: var(--sand); }
.section-head, .featured-rail, .place-grid, .around-list, .route-list, .map-layout, .saved-list, .route-controls, .split-section, .location-help {
  width: min(1280px, calc(100% - 28px));
  margin-left: auto;
  margin-right: auto;
}
.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 18px;
}
.section-head h2, .section h2 {
  font-family: var(--display);
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.05;
  font-weight: 500;
  margin: 0;
}

.featured-rail {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
}
.featured-card, .story {
  flex: 0 0 160px;
  scroll-snap-align: start;
  border: 0;
  padding: 0;
  background: none;
  text-align: left;
  color: inherit;
}
.featured-card img, .story img {
  width: 160px;
  height: 200px;
  object-fit: cover;
  border-radius: 18px;
}
.featured-card strong, .story span {
  display: block;
  margin-top: 8px;
  font-family: var(--display);
  font-size: 18px;
}

.place-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.pin {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background: var(--sage);
  min-width: 0;
}
.pin-photo {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  text-align: left;
}
.pin img, .pin .photo-pending {
  width: 100%;
  aspect-ratio: 4 / 5;
  height: auto;
  object-fit: contain;
  background: #1c1916;
  object-position: center;
}
.pin-shade {
  position: absolute;
  inset: auto 0 0;
  height: 46%;
  background: linear-gradient(to top, rgba(44,51,43,.82), transparent);
  pointer-events: none;
}
.pin-meta {
  position: absolute;
  left: 10px;
  right: 44px;
  bottom: 10px;
  color: #faf8f5;
  z-index: 1;
}
.pin-area, .pin-tag {
  display: inline-block;
  margin: 0 6px 6px 0;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(250,248,245,.18);
  border: 1px solid rgba(250,248,245,.28);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #faf8f5;
}
.pin-meta strong {
  display: block;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 500;
  line-height: 1.1;
}
.pin-actions {
  position: absolute;
  right: 8px;
  top: 8px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.pin-save, .pin-chip {
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(250,248,245,.96);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font: 650 12px/1 var(--sans, inherit);
  letter-spacing: 0.02em;
  box-shadow: 0 6px 16px rgba(28,25,22,.18);
}
.pin-save svg { display: block; flex: none; }
.pin-save.is-active { background: var(--ink); color: var(--paper); }
.pin-save.is-active { background: var(--ink); color: var(--paper); }

.route-controls { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.route-controls select {
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 999px;
  padding: 10px 14px;
  font: inherit;
}
.around-row, .route-row, .saved-row, .legend-row {
  display: flex;
  gap: 12px;
  align-items: center;
  width: 100%;
  background: var(--white);
  border: 0;
  border-radius: 14px;
  padding: 10px;
  margin-bottom: 10px;
  text-align: left;
  color: inherit;
}
.around-row img, .route-row img, .thumb-fallback {
  width: 72px;
  height: 72px;
  object-fit: cover;
  object-position: center;
  border-radius: 12px;
  flex: none;
  background: var(--sage);
}
.thumb-fallback {
  display: grid;
  place-items: center;
  font-weight: 600;
  color: var(--muted);
}
.around-copy, .legend-copy, .route-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.around-copy strong, .route-row strong, .saved-row strong, .route-copy strong {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 500;
}
.route-copy em, .route-copy small { color: var(--muted); font-style: italic; font-size: 13px; }

.map-layout { display: grid; grid-template-columns: 1.5fr 0.9fr; gap: 16px; align-items: start; }
.live-map { min-height: 420px; border-radius: 22px; overflow: hidden; background: var(--sage); }

.area-card {
  background: var(--white);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 12px;
  display: grid;
  grid-template-columns: 96px 1fr;
  min-height: 96px;
}
.area-card img, .area-card .thumb-fallback {
  width: 96px;
  height: 96px;
  object-fit: cover;
  object-position: center;
}
.area-card div { padding: 12px 14px; min-width: 0; }
.area-card h3 { font-family: var(--display); font-size: 22px; margin: 4px 0; font-weight: 500; }
.area-card button {
  margin-top: 8px;
  border: 0;
  background: var(--ink);
  color: var(--paper);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
}
.area-list:empty { display: none; }
.split-section { display: grid; grid-template-columns: 1.4fr 0.8fr; gap: 22px; }
.side-panel { background: var(--white); border-radius: 18px; padding: 22px; }
.side-panel h3 { font-family: var(--display); font-size: 24px; margin: 0 0 8px; font-weight: 500; }
.side-panel p, .side-panel dd { color: var(--muted); font-size: 14px; line-height: 1.45; }
.side-panel dt { font-weight: 600; margin-top: 12px; }

.empty-state, .rail-empty {
  background: var(--sand);
  border-radius: 18px;
  padding: 28px;
  color: var(--muted);
}
.empty-state h3, .rail-empty strong {
  font-family: var(--display);
  font-size: 28px;
  color: var(--ink);
  font-weight: 500;
  display: block;
}
section[hidden] { display: none !important; }

.site-footer {
  background: var(--ink);
  color: #d9d4cc;
  padding: 56px 20px 100px;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 32px;
}
.site-footer strong { font-family: var(--display); font-size: 32px; color: var(--paper); }
.motto-foot { font-family: var(--display); font-style: italic; font-size: 18px; color: var(--paper); }
.foot-links { display: flex; flex-direction: column; gap: 8px; }
.foot-links a { color: var(--paper); text-decoration: none; }
.build-stamp { display: block; margin-top: 12px; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: #8c877f; }

.mobile-nav {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: 64px;
  background: var(--white);
  border-top: 1px solid var(--line);
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  text-align: center;
  z-index: 30;
}
.mobile-nav a { color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 600; }

.place-dialog {
  width: min(920px, 94vw);
  border: 0;
  border-radius: 22px;
  padding: 0;
  background: var(--paper);
}
.place-dialog::backdrop { background: rgba(44, 51, 43, 0.5); }
.dialog-close {
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 2;
  border: 0;
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(250, 248, 245, 0.9);
}
.dialog-gallery { background: var(--sage); }
.dialog-photo img {
  width: 100%;
  height: min(70vh, 640px);
  object-fit: contain;
  object-position: center;
  background: #1c1916;
}
.dialog-photo-button { position: relative; display: block; width: 100%; border: 0; padding: 0; cursor: zoom-in; }
.image-expand-label {
  position: absolute;
  right: 12px;
  bottom: 12px;
  background: rgba(44,51,43,.8);
  color: var(--paper);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
}
.dialog-thumbs { display: flex; gap: 8px; overflow-x: auto; padding: 10px; }
.dialog-thumbs button {
  flex: 0 0 64px;
  height: 52px;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 8px;
  background: var(--white);
  padding: 0;
}
.dialog-thumbs button.is-active { border-color: var(--forest); }
.dialog-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.place-dialog.is-image-expanded .dialog-content,
.place-dialog.is-image-expanded .dialog-thumbs { display: none; }
.place-dialog.is-image-expanded .dialog-photo img { height: min(86vh, 720px); }
.disclaimer { font-size: 13px; color: #a8a39c; }
.dialog-content { padding: 22px 24px 28px; }
.dialog-content h2 { font-family: var(--display); font-size: 32px; margin: 6px 0 10px; font-weight: 500; }
.dialog-actions, .social-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.dialog-actions a, .social-links a {
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
}
.photo-pending {
  min-height: 220px;
  display: grid;
  place-items: center;
  background: var(--sage);
  color: var(--muted);
  text-align: center;
}
.hours-pill, .price-pill { font-size: 12px; background: var(--sand); border-radius: 999px; padding: 4px 8px; color: var(--muted); }
.map-popup { display: grid; gap: 4px; }

@media (min-width: 720px) {
  .place-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1100px) {
  .place-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
}



.amenity-tools { margin: 0 0 12px; }
.amenity-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.amenity-row span {
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--sand, #f0ebe3);
  font-size: 12px;
  font-weight: 650;
}
.build-stamp { display: block; margin-top: 12px; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: #8c877f; }
.hero-pills[hidden] { display: none !important; }

@media (max-width: 900px) {
  .desktop-nav { display: none; }
  body.v2 { padding-bottom: calc(52px + env(safe-area-inset-bottom, 0px)); }
  .app-header {
    flex-wrap: wrap;
    gap: 6px;
    padding: 6px 10px;
    min-height: 0;
  }
  .brand strong { font-size: 20px; }
  .brand-mark { width: 24px; height: 24px; }
  /* single slim search row */
  .search-slim {
    flex: 1 1 100%;
    order: 3;
    width: 100%;
    min-width: 0;
    flex-wrap: nowrap;
    border-radius: 999px;
    padding: 2px 4px 2px 10px;
    min-height: 40px;
    gap: 4px;
  }
  .search-slim select {
    max-width: 86px;
    flex: 0 0 auto;
    font-size: 13px;
  }
  .search-slim input {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    font-size: 13px;
  }
  .search-slim .btn-ink { display: none; }
  .search-slim .btn-ghost {
    flex: 0 0 auto;
    min-height: 32px;
    padding: 6px 10px;
    font-size: 12px;
  }
  .more-filters { padding: 8px 12px; gap: 8px; }
  .money-card { display: none; }
  /* short hero - one screen for venues */
  .hero { min-height: 0; }
  .hero-content { padding: 16px 14px 12px; }
  .hero h1 { font-size: 28px; line-height: 1; }
  .motto {
    font-size: 15px;
    margin-top: 4px;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .hero-pills, #heroHint { display: none !important; }
  .section { padding: 14px 0 18px; }
  .section-head { margin-bottom: 8px; }
  .section-head h2, .section h2 { font-size: 24px; }
  .section-head .eyebrow { margin-bottom: 2px; }
  .view-tools { margin-top: 6px; gap: 6px; }
  .chip { padding: 6px 10px; font-size: 12px; }
  .amenity-tools { margin: 0 10px 8px; }
  .place-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: calc(100% - 20px);
  }
  .pin { border-radius: 14px; margin-bottom: 0; }
  .pin img, .pin .photo-pending { aspect-ratio: 1 / 1; object-fit: cover; background: #1c1916; }
  .pin-meta { left: 8px; right: 8px; bottom: 8px; }
  .pin-meta strong { font-size: 14px; }
  .pin-tag { display: none; }
  .pin-actions { right: 6px; top: 6px; flex-direction: row; gap: 4px; }
  .pin-save, .pin-chip {
    width: 32px;
    height: 32px;
    min-height: 32px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
  }
  .pin-save span { display: none; }
  .map-layout, .site-footer, .split-section { grid-template-columns: 1fr; }
  .live-map, .leaflet-container { width: 100% !important; max-width: 100%; }
  .mobile-nav {
    display: grid;
    height: calc(52px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .live-map { min-height: 280px; }
  .place-dialog { width: 100vw; max-width: 100vw; height: 100%; max-height: 100%; border-radius: 0; }
  .dialog-photo img { height: min(55vh, 420px); object-fit: contain; }
  body.is-searching .hero,
  body.is-searching .mobile-nav { display: none; }
  body.is-searching { padding-bottom: 8px; }
}
