/* Step Into Historic Warrenton walking map
   Layout follows the holiday map. Visual language is a historic
   elliptical fanlight, not a holiday theme. */

:root {
  --ink: #2B2924;
  --ink-soft: #5A564C;
  --cream: #F4EFE4;
  --linen: #E7DFD0;
  --paper: #FBF8F1;
  --millwork: #EDE6D8;
  --millwork-shadow: #D4CBB8;
  --weathered: #7A7468;
  --weathered-light: #A39C90;
  --gold: #C2B184;
  --gold-dark: #8E7A4A;
  --glass: #C5CED4;
  --footer: #3A3732;
  --muted: #6A655C;
  --shadow: 0 8px 24px rgba(43, 41, 36, 0.14);
  --radius: 10px;
  --header-h: 64px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --app-height: 100svh;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html {
  height: 100%;
  height: 100svh;
  height: var(--app-height, 100svh);
}
body {
  height: 100%;
  height: 100svh;
  height: var(--app-height, 100svh);
  max-height: 100%;
  max-height: 100svh;
  max-height: var(--app-height, 100svh);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--cream);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: Georgia, "Palatino Linotype", Palatino, "Times New Roman", serif;
  margin: 0;
  line-height: 1.15;
  color: var(--ink);
}

a { color: var(--gold-dark); }
a:focus-visible, button:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

.skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 8px 12px;
  z-index: 4000;
}
.skip:focus { left: 8px; top: 8px; }

.preview-banner {
  flex: 0 0 auto;
  background: var(--gold);
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: center;
  padding: 5px 12px;
  padding-top: max(5px, var(--safe-top));
}

header.app-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: var(--header-h);
  padding: 6px 12px;
  background: var(--millwork);
  color: var(--ink);
  border-bottom: 0;
}

header .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
  color: inherit;
}
header .brand .fanlight {
  display: block;
  width: 72px;
  height: auto;
  flex: 0 0 auto;
}
header .brand .titles { min-width: 0; }
header .brand h1 {
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--ink);
  line-height: 1.08;
}
@media (max-width: 719px) {
  :root { --header-h: 48px; }
  header .brand p {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    white-space: normal;
  }
  .preview-banner {
    font-size: 0.64rem;
    padding: 3px 10px;
    padding-top: max(3px, var(--safe-top));
  }
  header.app-header { padding: 3px 10px; min-height: 44px; gap: 8px; }
  header .brand { gap: 6px; }
  header .brand .fanlight { width: 40px; }
  header .brand h1 { font-size: 0.96rem; line-height: 1.1; }
  header .brand p { font-size: 0.62rem; margin: 1px 0 0; }
  .header-actions .primary { min-height: 34px; padding: 5px 10px; font-size: 0.76rem; }
  .header-transom, .header-transom img { height: 10px; }
}
@media (max-width: 520px) {
  header .brand p { white-space: normal; }
}
@media (max-width: 390px) {
  header .brand .fanlight { width: 32px; }
  header .brand h1 { font-size: 0.88rem; }
}
header .brand p {
  margin: 3px 0 0;
  font-size: 0.72rem;
  color: var(--ink-soft);
}
header .brand .tagline {
  font-style: italic;
  color: var(--gold-dark);
  font-weight: 600;
}

.header-actions { flex: 0 0 auto; }
.header-actions .primary {
  appearance: none;
  border: 1px solid var(--gold-dark);
  background: var(--gold-dark);
  color: #fff;
  font-weight: 700;
  font-size: 0.86rem;
  padding: 8px 14px;
  min-height: 40px;
  border-radius: 999px;
  cursor: pointer;
}

.header-transom {
  flex: 0 0 auto;
  height: 20px;
  background: var(--linen);
  overflow: hidden;
  line-height: 0;
}
.header-transom img {
  display: block;
  width: 100%;
  height: 20px;
  object-fit: fill;
}

#map {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  background: #d9d6cf;
}
.leaflet-container { font: inherit; background: #d9d6cf; }

.locate-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1000;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid #c9c2b4;
  background: #fff;
  color: var(--ink);
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(43, 41, 36, 0.15);
  line-height: 1;
}
#map.popup-open .locate-btn { z-index: 350; }

/* Numbered fanlight pins */
.pin-wrap { background: transparent; border: 0; }
.pin {
  width: 30px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 2px 3px rgba(43, 41, 36, 0.35));
}
.pin svg { display: block; width: 30px; height: 26px; }
.pin.is-wide { width: 40px; height: 26px; }
.pin.is-wide svg { width: 40px; height: 26px; }
.pin.is-selected.is-wide { width: 44px; height: 30px; }
.pin.is-selected.is-wide svg { width: 44px; height: 30px; }
.pin .num {
  font: 700 10px/1 system-ui, "Segoe UI", sans-serif;
  fill: var(--ink);
}
.pin.is-selected {
  filter: drop-shadow(0 2px 5px rgba(142, 122, 74, 0.55));
}
.pin.is-bonus {
  filter: drop-shadow(0 1px 2px rgba(43, 41, 36, 0.25));
}
.pin.is-dim { filter: grayscale(0.6) opacity(0.42); }

.leaflet-container .leaflet-popup {
  opacity: 1 !important;
  visibility: visible !important;
}
.leaflet-popup-content-wrapper {
  border-radius: 12px;
  box-shadow: var(--shadow);
  background: var(--paper);
  border: 1px solid var(--millwork-shadow);
}
.leaflet-popup-content {
  margin: 12px 36px 14px 14px;
  min-width: 0;
  max-width: var(--popup-max-w, 280px);
  font-size: 0.88rem;
  max-height: var(--popup-max-h, none);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.leaflet-container a.leaflet-popup-close-button {
  width: 44px;
  height: 44px;
  padding: 0;
  font: 700 28px/44px system-ui, "Segoe UI", Tahoma, sans-serif;
  color: var(--ink);
  text-align: center;
  z-index: 2;
  -webkit-tap-highlight-color: transparent;
}
.leaflet-popup-scrolled {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.popup-card .photo.is-placeholder {
  height: 72px;
  object-fit: contain;
  background: var(--linen);
}
.popup-card .photo-thumbs {
  display: flex;
  gap: 6px;
  margin: 0 0 6px;
}
.popup-card .photo-thumb {
  appearance: none;
  border: 2px solid transparent;
  padding: 0;
  background: var(--linen);
  border-radius: 6px;
  width: 44px;
  height: 44px;
  overflow: hidden;
  cursor: pointer;
}
.popup-card .photo-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.popup-card .photo-thumb.is-selected { border-color: var(--gold-dark); }
.popup-card .share-photo-cta {
  display: block;
  margin: 0 0 6px;
  padding: 8px 10px;
  font-size: 0.78rem;
  text-align: center;
  text-decoration: none;
  font-weight: 800;
  color: #fff;
  background: var(--gold-dark);
  border-radius: 8px;
}
.popup-card .share-photo-note {
  margin: 0 0 8px;
  font-size: 0.68rem;
  line-height: 1.35;
  color: var(--ink-soft);
}
.popup-card h3 {
  font-size: 1.02rem;
  font-weight: 700;
  margin: 0 0 2px;
}
.popup-card .addr,
.popup-card .meta,
.popup-card .story,
.popup-card .photo-credit {
  margin: 0 0 6px;
  font-size: 0.78rem;
  color: var(--ink-soft);
}
.popup-card .meta { font-weight: 600; color: var(--ink); }
.popup-card .story { font-size: 0.8rem; color: var(--ink); }
.popup-card .photo {
  display: block;
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
  margin: 0 0 6px;
  background: var(--linen);
}
.popup-card .photo-credit { font-size: 0.66rem; line-height: 1.35; }
.popup-card .privacy {
  margin: 0 0 8px;
  padding: 6px 8px;
  background: var(--linen);
  border-left: 3px solid var(--gold-dark);
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--ink);
  border-radius: 0 6px 6px 0;
}
.popup-card .hours {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  font-size: 0.8rem;
}
.popup-card .hours li { padding: 2px 0; }
.popup-card .hours-note { font-size: 0.72rem; color: var(--ink-soft); margin: 0 0 8px; }

.panel-toggle { display: none; }
.dock {
  background: var(--paper);
  border-top: 3px solid var(--gold-dark);
  box-shadow: inset 0 2px 0 var(--gold);
  padding: 8px 12px 8px;
  z-index: 20;
  font-size: 0.85rem;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.dock-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 auto;
}
.filters {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  margin-bottom: 6px;
}
.filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
}
.loop-distances {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--ink-soft);
}
.loop-heading {
  margin: 10px 4px 4px;
  font-family: system-ui, sans-serif;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.loop-heading:first-child { margin-top: 2px; }
.loop-heading.is-north { color: var(--gold-dark); }
.loop-heading.is-south { color: var(--weathered); }
.loop-heading.is-bonus { color: var(--gold-dark); }
.bonus-distance {
  margin: 0 4px 6px;
  font-size: 0.7rem;
  line-height: 1.35;
  color: var(--ink-soft);
}
.result-row.is-bonus .num {
  background: var(--paper);
  border: 1.5px dashed var(--gold);
  border-radius: 999px;
}
.detail-card .loop-tag,
.popup-card .loop-tag {
  margin: 0 0 6px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gold-dark);
}
.leaflet-bottom.leaflet-left {
  max-width: calc(100% - 16rem);
}
.map-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  max-width: 100%;
  margin: 0 0 8px 8px;
  padding: 5px 8px;
  background: rgba(251, 248, 241, 0.94);
  border: 1px solid var(--millwork-shadow);
  border-radius: 8px;
  box-shadow: 0 1px 6px rgba(43, 41, 36, 0.16);
  color: var(--ink);
  font-size: 0.68rem;
  font-weight: 650;
  line-height: 1.15;
  pointer-events: auto;
}
.map-legend .key {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.map-legend .swatch {
  display: inline-block;
  width: 16px;
  height: 0;
  border-top: 3px solid var(--gold-dark);
  flex: 0 0 16px;
  margin-right: 2px;
}
.map-legend .swatch.dash {
  background: none;
  border-top: 0;
  height: 0;
  border-bottom: 3px dashed var(--weathered);
}
.map-legend .swatch.dot {
  background: none;
  border-top: 0;
  height: 0;
  border-bottom: 2px dotted #C2B184;
}
@media (max-width: 719px) {
  .leaflet-bottom.leaflet-left {
    max-width: calc(100% - 15.5rem);
  }
  .leaflet-bottom.leaflet-left .map-legend {
    flex-wrap: wrap;
    font-size: 0.6rem;
    gap: 3px 7px;
    padding: 3px 7px;
    margin: 0 8px 32px 8px;
    border-radius: 6px;
    max-width: 100%;
  }
  .map-legend .swatch { width: 14px; flex-basis: 14px; }
}
@media (min-width: 720px) {
  .map-legend {
    font-size: 0.72rem;
    gap: 8px 12px;
    padding: 6px 10px;
  }
}
.group-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.seg {
  display: inline-flex;
  flex-wrap: wrap;
  background: var(--cream);
  border: 1px solid #ddd4c4;
  border-radius: 999px;
  padding: 2px;
  gap: 2px;
}
.seg.wrap { border-radius: 16px; }
.seg button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  min-height: 36px;
}
.seg button[aria-pressed="true"] {
  background: var(--gold-dark);
  color: #fff;
}

.detail-card {
  background: var(--cream);
  border: 1px solid var(--millwork-shadow);
  border-radius: 12px;
  padding: 10px;
  margin: 0 0 8px;
  overflow: auto;
  flex: 0 0 auto;
  min-height: 0;
  max-height: min(52vh, 440px);
  -webkit-overflow-scrolling: touch;
}
.detail-card[hidden] { display: none; }
.detail-card .photo {
  display: block;
  width: 100%;
  height: 240px;
  object-fit: contain;
  object-position: center;
  border-radius: 8px;
  margin: 8px 0 6px;
  background: var(--linen);
}
.detail-card .photo.is-placeholder {
  height: 120px;
}
.detail-card .photo-thumbs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 0 0 6px;
}
.detail-card .photo-thumb {
  appearance: none;
  border: 2px solid transparent;
  background: var(--linen);
  padding: 0;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  min-height: 0;
}
.detail-card .photo-thumb img {
  display: block;
  width: 100%;
  height: 88px;
  object-fit: contain;
  background: var(--linen);
}
.detail-card .photo-thumb.is-selected {
  border-color: var(--gold-dark);
}
.detail-card h3 {
  font-size: 1.08rem;
  margin: 0 0 2px;
}
.detail-card .addr,
.detail-card .meta,
.detail-card .photo-credit,
.detail-card .hours-note,
.detail-card .phone {
  margin: 0 0 6px;
  font-size: 0.78rem;
  color: var(--ink-soft);
}
.detail-card .meta { font-weight: 600; color: var(--ink); }
.detail-card .story {
  margin: 0 0 6px;
  font-size: 0.86rem;
}
.detail-card .photo-credit { font-size: 0.66rem; line-height: 1.35; }
.detail-card .privacy {
  margin: 0 0 8px;
  padding: 6px 8px;
  background: var(--paper);
  border-left: 3px solid var(--gold-dark);
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: 0 6px 6px 0;
}
.detail-card .hours {
  list-style: none;
  margin: 0 0 6px;
  padding: 0;
  font-size: 0.82rem;
}
.detail-card .hours li { padding: 1px 0; }

.results {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 auto;
}
.results-head {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 4px 0 6px;
  color: var(--ink-soft);
  font-family: system-ui, sans-serif;
}
.results-list {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
}
.result-row {
  appearance: none;
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 8px;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid #efe6d6;
  background: transparent;
  color: inherit;
  padding: 8px 4px;
  cursor: pointer;
  font: inherit;
  align-items: start;
}
.result-row:last-child { border-bottom: 0; }
.result-row .num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  width: auto;
  height: 22px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--millwork);
  border: 1px solid var(--gold-dark);
  font-size: 0.62rem;
  font-weight: 800;
  color: var(--ink);
  margin-top: 1px;
}
.result-row .name {
  display: block;
  font-weight: 800;
  font-size: 0.92rem;
}
.result-row .meta {
  display: block;
  font-size: 0.75rem;
  color: var(--ink-soft);
}
.result-row.is-selected {
  background: var(--cream);
  border-radius: 8px;
  box-shadow: inset 3px 0 0 var(--gold-dark);
  padding-left: 8px;
}
.result-row.is-dim { opacity: 0.42; }

footer.partners {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px 14px;
  flex-wrap: wrap;
  background: var(--footer);
  color: #fff;
  padding: 6px 12px;
  padding-bottom: max(6px, var(--safe-bottom));
  z-index: 20;
}
.partners .slot {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}
.partners .slot.visit {
  background: #fff;
  border-radius: 8px;
  padding: 3px 6px;
}
.partners img { display: block; width: auto; }
.partners .visit img { height: 36px; max-width: 42vw; }
.partners .mcm img { height: 30px; max-width: 14vw; }
.partners .credit-line {
  margin: 0;
  font-size: 0.7rem;
  line-height: 1.3;
  text-align: center;
  max-width: 16rem;
  color: #f3eee4;
}

.drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(43, 41, 36, 0.4);
  z-index: 1500;
}
.drawer-backdrop.show { display: block; }
.drawer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: min(88dvh, 88svh);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--paper);
  border-radius: 16px 16px 0 0;
  z-index: 2000;
  transform: translateY(110%);
  transition: transform 0.28s ease;
  padding: 8px 16px 24px;
  padding-bottom: max(24px, var(--safe-bottom));
  box-shadow: var(--shadow);
}
.drawer.open { transform: translateY(0); }
.drawer .handle {
  width: 40px;
  height: 5px;
  border-radius: 999px;
  background: #c3b9a8;
  margin: 4px auto 8px;
  flex: 0 0 auto;
}
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  flex: 0 0 auto;
}
.drawer .body {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
  overscroll-behavior: contain;
}
.drawer .close {
  appearance: none;
  border: 0;
  background: transparent;
  font-size: 28px;
  line-height: 1;
  width: 44px;
  height: 44px;
  cursor: pointer;
  color: var(--ink);
}
.drawer .body p { margin: 0 0 10px; }
.drawer .lede { font-size: 1.02rem; font-weight: 650; }
.drawer h3 { margin: 14px 0 6px; font-size: 0.95rem; }
.drawer .note { font-size: 0.78rem; color: var(--ink-soft); }

.share-photo-cta {
  display: block;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  text-decoration: none;
  background: var(--gold-dark);
  color: #fff;
  font-weight: 800;
  font-size: 0.88rem;
  line-height: 1.25;
  padding: 10px 14px;
  border-radius: 10px;
  margin: 4px 0 6px;
}
.share-photo-cta:hover,
.share-photo-cta:focus-visible {
  background: #6f5d36;
  color: #fff;
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
.share-photo-note {
  margin: 0 0 8px;
  font-size: 0.68rem;
  line-height: 1.35;
  color: var(--ink-soft);
}

.drawer-cta {
  display: block;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  text-decoration: none;
  background: var(--gold-dark);
  color: #fff;
  font-weight: 800;
  font-size: 1.05rem;
  line-height: 1.25;
  padding: 14px 18px;
  border-radius: 12px;
  margin: 16px 0 14px;
}
.drawer-cta:hover,
.drawer-cta:focus-visible {
  background: #6f5d36;
  color: #fff;
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

@media (max-width: 719px) {
  #map {
    flex: 0 0 auto;
    height: var(--map-height, clamp(160px, min(40dvh, 40svh), calc(var(--app-height, 100svh) - 22rem)));
    min-height: 0;
    max-height: calc(var(--app-height, 100svh) - 16rem);
    transition: height 0.32s ease;
  }
  .dock {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 0 10px 6px;
  }
  .dock-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    max-height: 80svh;
    opacity: 1;
    transition: max-height 0.32s ease, opacity 0.2s ease;
  }
  .panel-toggle {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    appearance: none;
    border: 0;
    background: transparent;
    width: 100%;
    flex: 0 0 auto;
    margin: 0;
    padding: 8px 4px 6px;
    color: var(--ink);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: none;
  }
  .panel-handle {
    display: block;
    width: 40px;
    height: 5px;
    border-radius: 999px;
    background: #c9c2b4;
  }
  .panel-toggle-text {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    min-height: 0;
  }
  .panel-summary {
    font-weight: 800;
    font-size: 0.84rem;
    color: var(--ink);
    text-align: left;
  }
  .panel-toggle-label {
    font-weight: 700;
    font-size: 0.75rem;
    color: var(--gold-dark);
    white-space: nowrap;
  }
  body.panel-expanded .panel-toggle-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }
  body.panel-expanded .panel-toggle { padding: 10px 4px 2px; }
  body.panel-compact .dock {
    flex: 0 0 auto;
    overflow: hidden;
    padding: 0 12px 8px;
  }
  body.panel-compact .dock-body {
    max-height: 0;
    opacity: 0;
    pointer-events: none;
    flex: 0 0 0;
    min-height: 0;
    overflow: hidden;
  }
  body.panel-compact .panel-toggle {
    padding: 8px 4px 4px;
    min-height: 48px;
  }
  body.panel-compact #map { max-height: none; }
  body.panel-compact footer.partners { display: none; }
  body.panel-expanded .seg button {
    min-height: 40px;
    padding: 6px 11px;
    font-size: 0.8rem;
  }
  footer.partners {
    padding: 4px 10px;
    padding-bottom: max(4px, var(--safe-bottom));
  }
  .partners .visit img { height: 28px; }
  .partners .mcm img { height: 24px; }
  .partners .credit-line { max-width: 100%; flex: 1 1 100%; order: 3; font-size: 0.68rem; }
  body.short-viewport {
    height: auto;
    min-height: var(--app-height, 100svh);
    max-height: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  body.short-viewport .dock {
    flex: 0 0 auto;
    min-height: auto;
    overflow: visible;
  }
  body.short-viewport.panel-compact .dock { overflow: hidden; }
  body.short-viewport .results {
    flex: 0 0 auto;
    overflow: visible;
  }
  body.short-viewport .results-list {
    height: auto;
    max-height: none;
    overflow: visible;
  }
  body.panel-expanded .leaflet-bottom.leaflet-left .map-legend {
    margin: 0 8px 30px 8px;
    padding: 2px 6px;
    font-size: 0.56rem;
    gap: 2px 6px;
  }
}

@media (min-width: 720px) {
  .panel-toggle { display: none !important; }
  .results-list {
    height: min(30vh, 248px);
    max-height: none;
  }
  .leaflet-popup-content { max-width: var(--popup-max-w, 320px); }
  .partners img { max-width: none; }
  .drawer {
    left: auto;
    right: 16px;
    bottom: 16px;
    width: 400px;
    max-height: calc(100dvh - 32px);
    border-radius: 16px;
    padding-bottom: 8px;
  }
}

@media (min-width: 900px) {
  body {
    display: grid;
    grid-template-columns: minmax(320px, 1fr) 2fr;
    grid-template-rows: auto auto auto minmax(0, 1fr) auto;
    grid-template-areas:
      "banner banner"
      "header header"
      "transom transom"
      "dock   map"
      "footer footer";
  }
  .preview-banner { grid-area: banner; }
  header.app-header { grid-area: header; }
  .header-transom { grid-area: transom; }
  #map {
    grid-area: map;
    min-height: 0;
    height: auto;
  }
  .dock {
    grid-area: dock;
    min-height: 0;
    overflow: hidden;
    border-top: 0;
    border-right: 3px solid var(--gold-dark);
    padding: 12px 14px 8px;
  }
  .filters { flex-shrink: 0; }
  .results {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }
  .results-head { flex-shrink: 0; }
  .results-list {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
    max-height: none;
  }
  footer.partners {
    grid-area: footer;
    gap: 10px 16px;
    padding: 6px 16px;
  }
  .partners .visit img { height: 30px; }
  .partners .mcm img { height: 26px; }
  .partners .credit-line { max-width: 22rem; }
}

@media (prefers-reduced-motion: reduce) {
  #map, .dock-body, .drawer { transition: none; }
}




.wheel-hint {
  position: absolute;
  inset: 0;
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(43, 41, 36, 0.45);
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.wheel-hint.show { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .wheel-hint { transition: none; }
}

/* Welcome modal: transom style, shown on every page load */
.welcome-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(43, 41, 36, 0.45);
  z-index: 5000;
}
.welcome-backdrop.is-open { display: block; }
.welcome-modal {
  display: none;
  position: fixed;
  z-index: 5001;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: calc(100% - 32px);
  max-width: 440px;
  max-height: calc(var(--app-height, 100svh) - 32px);
  overflow: auto;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--millwork-shadow);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 20px 22px 22px;
  box-sizing: border-box;
}
.welcome-modal.is-open { display: block; }
.welcome-modal .welcome-fanlight {
  display: block;
  width: 120px;
  height: auto;
  margin: 0 auto 8px;
}
.welcome-modal h2 {
  text-align: center;
  font-size: 1.22rem;
  line-height: 1.2;
  margin: 0 0 8px;
}
.welcome-modal .welcome-transom {
  display: block;
  width: 100%;
  height: 14px;
  object-fit: cover;
  object-position: center;
  margin: 0 0 14px;
  opacity: 0.9;
}
.welcome-modal .welcome-copy p {
  margin: 0 0 10px;
  font-size: 0.95rem;
  line-height: 1.5;
}
.welcome-modal .welcome-tagline {
  text-align: center;
  font-family: Georgia, "Palatino Linotype", Palatino, "Times New Roman", serif;
  font-style: italic;
  font-weight: 600;
  color: var(--gold-dark);
  margin: 4px 0 16px;
}
.welcome-cta {
  display: block;
  width: 100%;
  appearance: none;
  border: 0;
  cursor: pointer;
  text-align: center;
  background: var(--gold-dark);
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  line-height: 1.25;
  padding: 12px 16px;
  border-radius: 12px;
}
.welcome-cta:hover,
.welcome-cta:focus-visible {
  background: #6f5d36;
  color: #fff;
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
body.welcome-open {
  overflow: hidden;
}
