:root {
  color-scheme: light;
  --ink: #211d1a;
  --muted: #6e675f;
  --paper: #f7f2e9;
  --surface: #fffdf9;
  --line: #ded7cb;
  --accent: #d44b3f;
  --accent-deep: #a9342b;
  --open: #168a5b;
  --closed: #ce493e;
  --unknown: #7a7770;
  --blue: #2878d0;
  --shadow: 0 18px 48px rgb(46 35 25 / 0.16), 0 3px 12px rgb(46 35 25 / 0.1);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 13px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
}

button,
input {
  font: inherit;
}

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

button:focus-visible,
a:focus-visible,
input:focus-visible,
#map:focus-visible {
  outline: 3px solid rgb(40 120 208 / 0.38);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  z-index: 3000;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  transform: translateY(-150%);
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
}

.skip-link:focus {
  transform: translateY(0);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.mobile-only {
  display: none !important;
}

.app-shell {
  position: relative;
  display: grid;
  grid-template-columns: 390px minmax(0, 1fr);
  width: 100%;
  height: 100%;
}

.sidebar {
  position: relative;
  z-index: 900;
  display: flex;
  min-height: 0;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: var(--paper);
  box-shadow: 8px 0 28px rgb(39 30 24 / 0.08);
}

.control-card {
  position: relative;
  z-index: 2;
  padding: 24px 22px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.brand-row,
.results-heading,
.detail-topline,
.filter-meta,
.address-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--accent-deep);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  line-height: 1.2;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.85rem, 4vw, 2.3rem);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1;
}

h1 span {
  color: var(--accent);
  font-style: italic;
}

.icon-button {
  display: inline-grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  cursor: pointer;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  transition: 160ms ease;
}

.icon-button:hover {
  border-color: #bbb1a2;
  transform: translateY(-1px);
}

.icon-button svg {
  width: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.location-button.locating svg {
  animation: locate-spin 1.1s linear infinite;
}

.location-button.located {
  border-color: rgb(40 120 208 / 0.35);
  background: #eaf4ff;
  color: var(--blue);
}

@keyframes locate-spin {
  to { transform: rotate(360deg); }
}

.search-wrap {
  position: relative;
  margin-top: 20px;
}

.search-wrap > svg {
  position: absolute;
  top: 50%;
  left: 14px;
  width: 20px;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--muted);
  stroke-linecap: round;
  stroke-width: 1.8;
  pointer-events: none;
}

.search-wrap input {
  width: 100%;
  height: 48px;
  padding: 0 15px 0 43px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.92rem;
  transition: 160ms ease;
}

.search-wrap input::placeholder {
  color: #8d857b;
}

.search-wrap input:focus {
  border-color: #a79d91;
  box-shadow: 0 0 0 4px rgb(120 105 90 / 0.08);
}

.filter-row {
  display: flex;
  gap: 7px;
  margin: 12px -2px 0;
  padding: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}

.filter-row::-webkit-scrollbar {
  display: none;
}

.filter-chip,
.toggle-button,
.text-button {
  cursor: pointer;
  border: 0;
}

.filter-chip {
  min-height: 35px;
  flex: 0 0 auto;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgb(255 253 249 / 0.75);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.filter-chip.active {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.filter-meta {
  margin-top: 12px;
}

.toggle-button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  font-size: 0.79rem;
  font-weight: 750;
}

.toggle-button.active {
  border-color: rgb(22 138 91 / 0.35);
  background: rgb(22 138 91 / 0.09);
  color: #0c6843;
}

.text-button {
  padding: 7px 0;
  background: transparent;
  color: var(--accent-deep);
  font-size: 0.79rem;
  font-weight: 750;
}

.status-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgb(0 0 0 / 0.11);
}

.status-open { background: var(--open); }
.status-closed { background: var(--closed); }
.status-unknown { background: var(--unknown); }

.results-panel {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  padding: 18px 12px 0;
}

.results-heading {
  padding: 0 10px 12px;
}

.results-heading h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.22rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.results-list {
  min-height: 0;
  flex: 1;
  padding-bottom: 22px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: #c9c1b7 transparent;
  scrollbar-width: thin;
}

.spot-list-item {
  display: grid;
  width: 100%;
  min-height: 70px;
  grid-template-columns: 12px minmax(0, 1fr) auto 16px;
  align-items: center;
  gap: 10px;
  padding: 11px 10px;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  transition: 140ms ease;
}

.spot-list-item + .spot-list-item {
  margin-top: 3px;
}

.spot-list-item:hover {
  background: rgb(255 253 249 / 0.84);
}

.spot-list-item.selected {
  border-color: var(--line);
  background: var(--surface);
  box-shadow: 0 5px 16px rgb(35 28 22 / 0.06);
}

.spot-list-item > svg {
  width: 16px;
  fill: none;
  stroke: #9d9489;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.spot-list-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.spot-list-copy strong {
  overflow: hidden;
  font-size: 0.87rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spot-list-copy > span {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spot-list-rating {
  color: #aa6f0b;
  font-size: 0.73rem;
  font-weight: 750;
  white-space: nowrap;
}

.empty-state {
  margin: 24px 14px;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.55;
}

.map-stage,
#map {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.map-stage {
  isolation: isolate;
}

#map {
  z-index: 0;
  background: #ddd8cf;
}

.leaflet-control-zoom {
  overflow: hidden;
  border: 1px solid var(--line) !important;
  border-radius: 13px !important;
  box-shadow: 0 6px 18px rgb(36 28 22 / 0.15) !important;
}

.leaflet-control-zoom a {
  width: 42px !important;
  height: 42px !important;
  border-color: var(--line) !important;
  background: var(--surface) !important;
  color: var(--ink) !important;
  line-height: 42px !important;
}

.leaflet-bottom.leaflet-right {
  right: max(6px, env(safe-area-inset-right));
  bottom: max(6px, env(safe-area-inset-bottom));
}

.leaflet-control-attribution {
  background: rgb(255 255 255 / 0.82) !important;
  color: #5c5750;
  font-size: 10px !important;
  backdrop-filter: blur(6px);
}

.spot-marker {
  filter: drop-shadow(0 2px 3px rgb(27 20 15 / 0.25));
  cursor: pointer;
  transition: 130ms ease;
}

.spot-label {
  padding: 5px 8px !important;
  border: 1px solid rgb(91 76 62 / 0.17) !important;
  border-radius: 8px !important;
  background: rgb(255 253 249 / 0.94) !important;
  box-shadow: 0 4px 12px rgb(35 28 22 / 0.13) !important;
  color: var(--ink) !important;
  font-size: 11px !important;
  font-weight: 750 !important;
  cursor: pointer;
  pointer-events: auto;
  white-space: nowrap;
}

.spot-label:focus-visible {
  outline: 3px solid rgb(40 120 208 / 0.42);
  outline-offset: 2px;
}

.spot-label::before {
  display: none;
}

.map-legend {
  position: absolute;
  z-index: 700;
  top: 18px;
  right: 18px;
  display: flex;
  gap: 13px;
  padding: 9px 12px;
  border: 1px solid rgb(100 86 72 / 0.14);
  border-radius: 999px;
  background: rgb(255 253 249 / 0.9);
  box-shadow: 0 6px 18px rgb(38 29 22 / 0.1);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  backdrop-filter: blur(10px);
}

.map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.legend-open { background: var(--open); }
.legend-closed { background: var(--closed); }
.legend-unknown { background: var(--unknown); }

.detail-sheet {
  position: absolute;
  z-index: 850;
  right: 20px;
  bottom: 20px;
  width: min(440px, calc(100% - 40px));
  max-height: min(76vh, 720px);
  padding: 22px;
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: translateY(18px) scale(0.985);
  border: 1px solid rgb(95 78 64 / 0.16);
  border-radius: var(--radius-xl);
  background: rgb(255 253 249 / 0.98);
  box-shadow: var(--shadow);
  opacity: 0;
  backdrop-filter: blur(14px);
  transition: 220ms cubic-bezier(.2,.8,.2,1);
}

.detail-sheet.open {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.detail-close {
  position: sticky;
  z-index: 5;
  top: 0;
  display: grid;
  width: 38px;
  height: 38px;
  margin: -8px -8px -30px auto;
  box-shadow: 0 3px 10px rgb(35 28 22 / 0.1);
}

.detail-topline {
  justify-content: flex-start;
  padding-right: 40px;
}

.category-label {
  overflow: hidden;
  color: var(--accent-deep);
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.status-pill {
  display: inline-flex;
  min-height: 29px;
  align-items: center;
  gap: 7px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  white-space: nowrap;
}

.status-pill-open { background: #e4f4eb; color: #0c6843; }
.status-pill-closed { background: #f9e8e5; color: #9e3129; }
.status-pill-unknown { background: #eceae6; color: #5f5c57; }

.detail-sheet h2 {
  margin: 13px 42px 8px 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.65rem, 5vw, 2.2rem);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.04;
}

.detail-rating {
  color: #9b670c;
  font-size: 0.83rem;
}

.detail-rating p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.75rem;
  font-style: italic;
  line-height: 1.45;
}

.rating-value {
  font-weight: 800;
}

.rating-empty {
  color: var(--muted);
  font-size: 0.75rem;
}

.detail-description {
  margin: 17px 0;
  color: #4f4943;
  font-size: 0.88rem;
  line-height: 1.6;
}

.detail-block {
  padding: 13px 0;
  border-top: 1px solid var(--line);
}

.detail-label {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.address-row {
  align-items: flex-start;
}

.address-row > span {
  padding-top: 7px;
  font-size: 0.86rem;
  font-weight: 650;
  line-height: 1.4;
}

.copy-button {
  display: inline-flex;
  min-height: 38px;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  cursor: pointer;
  border: 1px solid #c9beb0;
  border-radius: 11px;
  background: var(--paper);
  color: var(--ink);
  font-size: 0.74rem;
  font-weight: 800;
}

.copy-button svg,
.map-link svg,
.mobile-results-button svg {
  width: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.hours-block strong {
  display: block;
  color: var(--ink);
  font-size: 0.88rem;
}

.hours-block > p:not(.detail-label) {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.hours-block small {
  display: block;
  margin-top: 8px;
  color: #817970;
  font-size: 0.67rem;
  line-height: 1.4;
}

.map-link {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  color: var(--accent-deep);
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
}

.toast {
  position: absolute;
  z-index: 1200;
  bottom: 28px;
  left: 50%;
  max-width: calc(100% - 32px);
  padding: 11px 15px;
  transform: translate(-50%, 20px);
  border-radius: 12px;
  background: var(--ink);
  box-shadow: 0 10px 30px rgb(0 0 0 / 0.24);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: 180ms ease;
}

.toast.visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

.user-location-icon {
  background: transparent;
}

.user-location-core,
.user-location-pulse {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
}

.user-location-core {
  width: 14px;
  height: 14px;
  transform: translate(-50%, -50%);
  border: 3px solid #fff;
  background: var(--blue);
  box-shadow: 0 2px 8px rgb(20 73 128 / 0.35);
}

.user-location-pulse {
  width: 28px;
  height: 28px;
  transform: translate(-50%, -50%);
  background: rgb(40 120 208 / 0.2);
  animation: location-pulse 2.2s ease-out infinite;
}

@keyframes location-pulse {
  0% { transform: translate(-50%, -50%) scale(0.55); opacity: 1; }
  85%, 100% { transform: translate(-50%, -50%) scale(1.35); opacity: 0; }
}

.clipboard-fallback {
  position: fixed;
  left: -9999px;
}

noscript {
  position: fixed;
  z-index: 4000;
  inset: 20px;
  display: grid;
  place-items: center;
  background: var(--surface);
  color: var(--ink);
}

@media (max-width: 760px) {
  .desktop-only {
    display: none !important;
  }

  .mobile-only {
    display: inline-grid !important;
  }

  .app-shell {
    display: block;
  }

  .map-stage {
    position: absolute;
    inset: 0;
  }

  .sidebar {
    position: absolute;
    z-index: 900;
    top: max(10px, env(safe-area-inset-top));
    right: 10px;
    left: 10px;
    display: block;
    min-height: auto;
    border: 0;
    background: transparent;
    box-shadow: none;
    pointer-events: none;
    transition: transform 180ms ease, opacity 180ms ease, visibility 180ms ease;
  }

  .control-card {
    padding: 13px;
    border: 1px solid rgb(89 73 59 / 0.15);
    border-radius: 19px;
    background: rgb(247 242 233 / 0.94);
    box-shadow: 0 10px 28px rgb(43 32 24 / 0.15);
    backdrop-filter: blur(14px);
    pointer-events: auto;
  }

  .brand-row {
    min-height: 36px;
  }

  .brand-row .eyebrow {
    display: none;
  }

  h1 {
    font-size: 1.55rem;
  }

  .location-button {
    width: 40px;
    height: 40px;
  }

  .collapse-controls.mobile-only {
    position: relative;
    top: -12px;
    display: inline-grid !important;
    width: 48px;
    height: 48px;
    margin-left: -11px;
  }

  .expand-controls.mobile-only {
    position: absolute;
    z-index: 700;
    top: max(12px, env(safe-area-inset-top));
    left: 12px;
    display: none !important;
    width: 48px;
    height: 48px;
    cursor: pointer;
    place-items: center;
    border: 1px solid rgb(89 73 59 / 0.18);
    border-radius: 50%;
    background: rgb(247 242 233 / 0.96);
    box-shadow: 0 8px 24px rgb(39 30 23 / 0.22);
    color: var(--ink);
    backdrop-filter: blur(12px);
  }

  .expand-controls svg {
    width: 23px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.9;
  }

  body.controls-collapsed .sidebar {
    transform: translateY(-18px);
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
  }

  body.controls-collapsed .expand-controls.mobile-only {
    display: inline-grid !important;
  }

  .search-wrap {
    margin-top: 10px;
  }

  .search-wrap input {
    height: 44px;
    background: rgb(255 253 249 / 0.92);
  }

  .filter-row {
    margin-top: 9px;
  }

  .filter-meta {
    margin-top: 8px;
  }

  .toggle-button {
    min-height: 35px;
    padding: 6px 10px;
  }

  .results-panel {
    display: none;
  }

  .sidebar.results-open {
    bottom: max(10px, env(safe-area-inset-bottom));
    display: flex;
    overflow: hidden;
    border: 1px solid rgb(89 73 59 / 0.15);
    border-radius: 21px;
    background: var(--paper);
    box-shadow: var(--shadow);
    pointer-events: auto;
  }

  .sidebar.results-open .control-card {
    flex: 0 0 auto;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    box-shadow: none;
  }

  .sidebar.results-open .results-panel {
    display: flex;
    padding-top: 14px;
  }

  .results-heading .icon-button {
    display: inline-grid;
    width: 38px;
    height: 38px;
  }

  .map-legend {
    top: auto;
    right: 12px;
    bottom: calc(max(12px, env(safe-area-inset-bottom)) + 60px);
    gap: 8px;
    padding: 7px 9px;
    font-size: 0.62rem;
  }

  .mobile-results-button.mobile-only {
    position: absolute;
    z-index: 700;
    bottom: max(14px, env(safe-area-inset-bottom));
    left: 12px;
    display: inline-flex !important;
    min-height: 45px;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    cursor: pointer;
    border: 1px solid rgb(89 73 59 / 0.15);
    border-radius: 999px;
    background: var(--ink);
    box-shadow: 0 7px 22px rgb(39 30 23 / 0.25);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 800;
  }

  .leaflet-bottom.leaflet-right {
    bottom: calc(max(10px, env(safe-area-inset-bottom)) + 48px);
  }

  .leaflet-control-attribution {
    max-width: 58vw;
    overflow: hidden;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .detail-sheet {
    z-index: 1000;
    right: 8px;
    bottom: max(8px, env(safe-area-inset-bottom));
    left: 8px;
    width: auto;
    max-height: min(72vh, 680px);
    padding: 19px 18px 20px;
    border-radius: 22px;
  }

  body.detail-mode .sidebar {
    transform: translateY(-12px);
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
  }

  body.detail-mode .map-legend,
  body.detail-mode .mobile-results-button,
  body.detail-mode .expand-controls {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
  }

  body.detail-mode .detail-sheet {
    top: max(8px, env(safe-area-inset-top));
    bottom: max(8px, env(safe-area-inset-bottom));
    max-height: none;
  }

  body.detail-mode .detail-close {
    width: 44px;
    height: 44px;
    margin-top: -9px;
    margin-right: -9px;
    margin-bottom: -35px;
  }

  .detail-sheet h2 {
    font-size: 1.72rem;
  }

  .detail-topline {
    flex-wrap: wrap;
    gap: 7px;
  }

  .address-row {
    align-items: stretch;
    flex-direction: column;
  }

  .copy-button {
    min-height: 44px;
    align-self: flex-start;
  }

  .toast {
    bottom: calc(max(15px, env(safe-area-inset-bottom)) + 57px);
    width: max-content;
  }
}

@media (max-width: 410px) {
  .control-card {
    padding: 11px;
  }

  .collapse-controls.mobile-only {
    top: -10px;
    margin-left: -10px;
  }

  .map-legend span:last-child {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
