:root {
  --ink: #172b33;
  --ink-soft: #49606a;
  --paper: #fbf6ed;
  --paper-deep: #f3eadb;
  --line: #ded2c2;
  --sea: #b9d4d6;
  --sea-deep: #6e9ca0;
  --coral: #dc6b4d;
  --coral-dark: #a84835;
  --teal: #2d7a7b;
  --mustard: #d0a152;
  --gray: #92a2a0;
  --white: #ffffff;
  --shadow: 0 20px 50px rgba(23, 43, 51, 0.16);
  --radius-lg: 26px;
  --radius-md: 16px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--sea);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.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;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(360px, 430px) minmax(0, 1fr);
  min-height: 100vh;
  background: var(--sea);
}

.sidebar {
  position: relative;
  z-index: 4;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-height: 100vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--paper);
  border-right: 1px solid rgba(23, 43, 51, 0.13);
  box-shadow: 18px 0 48px rgba(23, 43, 51, 0.13);
}

.brand-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 26px 12px;
  color: var(--ink-soft);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.brand {
  text-decoration: none;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: 0.11em;
}
.brand span { color: var(--coral); }
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-soft);
  letter-spacing: 0.08em;
  font-size: 10px;
  white-space: nowrap;
}
.status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--teal);
  box-shadow: 0 0 0 4px rgba(45, 122, 123, 0.13);
}

.hero {
  padding: 10px 26px 24px;
  border-bottom: 1px solid var(--line);
}
.eyebrow {
  margin: 0 0 10px;
  color: var(--coral-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
.hero h1 {
  max-width: 355px;
  margin: 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(35px, 4vw, 47px);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 0.99;
}
.hero h1 em {
  color: var(--coral);
  font-style: italic;
}
.hero-copy {
  max-width: 340px;
  margin: 16px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.55;
}
.hero-rule {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 19px;
  color: var(--ink-soft);
  font-size: 11px;
  letter-spacing: 0.04em;
}
.hero-rule::before {
  content: "";
  width: 34px;
  height: 1px;
  background: var(--coral);
}

.controls { padding: 18px 26px 12px; }
.search-wrap {
  position: relative;
  display: block;
}
.search-wrap svg {
  position: absolute;
  top: 50%;
  left: 14px;
  width: 17px;
  height: 17px;
  color: var(--ink-soft);
  transform: translateY(-50%);
  pointer-events: none;
}
.search {
  width: 100%;
  padding: 13px 40px 13px 42px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: none;
  font-size: 14px;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.search::placeholder { color: #829092; }
.search:focus {
  background: var(--white);
  border-color: var(--coral);
  box-shadow: 0 0 0 4px rgba(220, 107, 77, 0.12);
}
.clear-search {
  position: absolute;
  top: 50%;
  right: 9px;
  display: none;
  width: 26px;
  height: 26px;
  padding: 0;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  border-radius: 50%;
  transform: translateY(-50%);
}
.clear-search:hover { background: var(--paper-deep); }
.search-wrap.has-value .clear-search { display: inline-grid; place-items: center; }

.filter-label {
  display: block;
  margin: 19px 0 9px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
.category-row {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 1px 1px 4px;
  scrollbar-width: none;
}
.category-row::-webkit-scrollbar { display: none; }
.category {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 12px;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  transition: color .18s, background .18s, border-color .18s, transform .18s;
}
.category:hover { border-color: var(--ink-soft); transform: translateY(-1px); }
.category.active { color: var(--white); background: var(--ink); border-color: var(--ink); }
.category-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gray);
}
.category[data-category="coffee"] .category-dot { background: var(--coral); }
.category[data-category="sandwich"] .category-dot { background: var(--teal); }
.category[data-category="work"] .category-dot { background: var(--mustard); }
.category.active .category-dot { background: currentColor; opacity: .75; }

.filter-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 10px;
}
.select-wrap { position: relative; }
.select-wrap::after {
  content: "⌄";
  position: absolute;
  top: 50%;
  right: 13px;
  color: var(--ink-soft);
  transform: translateY(-56%);
  pointer-events: none;
}
.area-select {
  width: 100%;
  min-height: 39px;
  padding: 0 32px 0 12px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: none;
  appearance: none;
  font-size: 12px;
  font-weight: 650;
}
.area-select:focus { border-color: var(--coral); box-shadow: 0 0 0 4px rgba(220, 107, 77, 0.1); }
.compact-button {
  min-height: 39px;
  padding: 0 12px;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 11px;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}
.compact-button:hover { border-color: var(--ink-soft); background: rgba(255, 255, 255, .5); }
.compact-button:active { transform: translateY(1px); }

.check-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 11px;
  color: var(--ink-soft);
  font-size: 12px;
}
.check-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.check-label input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--coral);
}
.share-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  color: var(--coral-dark);
  background: transparent;
  border: 0;
  font-size: 12px;
  font-weight: 750;
}
.share-button:hover { text-decoration: underline; }

.results-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 26px 10px;
  border-top: 1px solid var(--line);
}
.results-title {
  margin: 0;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.025em;
}
.results-count {
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.3;
  text-align: right;
}
.list {
  display: grid;
  gap: 9px;
  padding: 0 18px 18px;
}
.place-card {
  position: relative;
  display: grid;
  grid-template-columns: 33px minmax(0, 1fr);
  gap: 12px;
  padding: 13px 12px 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, .55);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  text-align: left;
  transition: background .18s, border-color .18s, transform .18s, box-shadow .18s;
}
.place-card:hover, .place-card.selected {
  background: var(--white);
  border-color: var(--line);
  box-shadow: 0 8px 20px rgba(23, 43, 51, .08);
  transform: translateY(-1px);
}
.place-card:focus-visible { outline: 3px solid rgba(220, 107, 77, .28); outline-offset: 2px; }
.place-index {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: var(--white);
  background: var(--ink);
  border-radius: 10px;
  font-size: 12px;
  font-weight: 800;
}
.place-card.coffee .place-index { background: var(--coral); }
.place-card.sandwich .place-index { background: var(--teal); }
.place-card.work .place-index { background: var(--mustard); color: var(--ink); }
.place-main { min-width: 0; }
.place-topline {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.place-name {
  overflow: hidden;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.place-rank {
  flex: 0 0 auto;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 750;
}
.place-meta {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.35;
}
.place-specialty {
  margin-top: 7px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}
.place-note {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: 11px;
  font-style: italic;
  line-height: 1.38;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.place-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
}
.place-tag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 7px;
  color: var(--ink-soft);
  background: var(--paper-deep);
  border-radius: 7px;
  font-size: 10px;
  font-weight: 700;
}
.place-tag.source { color: var(--coral-dark); background: rgba(220, 107, 77, .11); }
.place-tag.unverified { color: #79653a; background: rgba(208, 161, 82, .18); }
.open-map {
  margin-left: auto;
  color: var(--coral-dark);
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
}
.open-map:hover { text-decoration: underline; }
.no-results {
  margin: 0 8px 18px;
  padding: 24px 16px;
  color: var(--ink-soft);
  background: var(--paper-deep);
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}
.no-results button {
  margin-top: 12px;
  padding: 8px 12px;
  color: var(--white);
  background: var(--ink);
  border: 0;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 750;
}

.source-footer {
  margin-top: auto;
  padding: 17px 26px 24px;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
  font-size: 10.5px;
  line-height: 1.5;
}
.source-footer strong { color: var(--ink); }
.source-list { display: flex; flex-wrap: wrap; gap: 5px 9px; margin: 9px 0; }
.source-list span { color: var(--ink); font-weight: 700; }
.disclaimer { color: #7c8989; }

.map-column {
  position: relative;
  min-width: 0;
  min-height: 100vh;
  overflow: hidden;
  background: #b8d0d1;
}
#map {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: #b8d0d1;
}
.leaflet-container { font-family: var(--sans); }
.leaflet-tile { filter: saturate(.72) sepia(.13) brightness(1.03); }
.leaflet-control-zoom {
  margin-top: 92px !important;
  margin-left: 20px !important;
  border: 0 !important;
  box-shadow: 0 8px 24px rgba(23, 43, 51, .18) !important;
}
.leaflet-control-zoom a {
  color: var(--ink) !important;
  background: var(--paper) !important;
  border: 0 !important;
}
.leaflet-control-zoom a:hover { background: var(--white) !important; }
.leaflet-control-attribution {
  color: #536b6e !important;
  background: rgba(251, 246, 237, .75) !important;
  font-size: 9px !important;
}
.leaflet-control-attribution a { color: var(--ink) !important; }

.map-header {
  position: absolute;
  top: 20px;
  right: 20px;
  left: 20px;
  z-index: 3;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  pointer-events: none;
}
.map-stamp {
  max-width: 330px;
  padding: 12px 15px;
  color: var(--ink);
  background: rgba(251, 246, 237, .88);
  border: 1px solid rgba(23, 43, 51, .11);
  border-radius: 14px;
  box-shadow: 0 8px 22px rgba(23, 43, 51, .14);
  backdrop-filter: blur(9px);
}
.map-stamp .small {
  color: var(--coral-dark);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.map-stamp strong {
  display: block;
  margin-top: 3px;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
}
.map-actions {
  display: flex;
  gap: 8px;
  pointer-events: auto;
}
.map-action {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 39px;
  padding: 0 12px;
  color: var(--ink);
  background: rgba(251, 246, 237, .9);
  border: 1px solid rgba(23, 43, 51, .12);
  border-radius: 11px;
  box-shadow: 0 8px 22px rgba(23, 43, 51, .12);
  backdrop-filter: blur(9px);
  font-size: 11px;
  font-weight: 800;
}
.map-action:hover { background: var(--white); }
.map-action svg { width: 15px; height: 15px; }
.map-legend {
  position: absolute;
  right: 20px;
  bottom: 25px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  color: var(--ink-soft);
  background: rgba(251, 246, 237, .88);
  border: 1px solid rgba(23, 43, 51, .11);
  border-radius: 12px;
  box-shadow: 0 8px 22px rgba(23, 43, 51, .12);
  backdrop-filter: blur(9px);
  font-size: 10px;
  font-weight: 750;
}
.legend-item { display: inline-flex; align-items: center; gap: 5px; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; }
.legend-dot.coffee { background: var(--coral); }
.legend-dot.sandwich { background: var(--teal); }
.legend-dot.work { background: var(--mustard); }

.tlv-marker {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  color: var(--white);
  border: 2px solid var(--white);
  border-radius: 50% 50% 50% 4px;
  box-shadow: 0 5px 13px rgba(23, 43, 51, .29);
  transform: rotate(-45deg);
  font-size: 10px;
  font-weight: 850;
}
.tlv-marker span { transform: rotate(45deg); }
.tlv-marker.coffee { background: var(--coral); }
.tlv-marker.sandwich { background: var(--teal); }
.tlv-marker.work { background: var(--mustard); color: var(--ink); }
.leaflet-popup-content-wrapper {
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(23, 43, 51, .19);
}
.leaflet-popup-tip { background: var(--paper); }
.leaflet-popup-content { min-width: 205px; margin: 13px 15px 14px; }
.popup-source {
  color: var(--coral-dark);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.popup-title {
  margin-top: 4px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.05;
}
.popup-address { margin-top: 7px; color: var(--ink-soft); font-size: 11px; line-height: 1.35; }
.popup-link { display: inline-block; margin-top: 10px; color: var(--coral-dark); font-size: 11px; font-weight: 800; text-decoration: none; }
.popup-link:hover { text-decoration: underline; }
.popup-badge {
  display: inline-flex;
  margin-top: 9px;
  padding: 4px 7px;
  color: var(--ink);
  background: rgba(208, 161, 82, .18);
  border-radius: 6px;
  font-size: 10px;
  font-weight: 750;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 10;
  max-width: 300px;
  padding: 11px 14px;
  color: var(--white);
  background: var(--ink);
  border-radius: 10px;
  box-shadow: var(--shadow);
  font-size: 12px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity .2s, transform .2s;
}
.toast.visible { opacity: 1; transform: translateY(0); }

@media (max-width: 920px) {
  .app-shell { grid-template-columns: minmax(320px, 380px) minmax(0, 1fr); }
  .brand-bar, .hero, .controls, .results-head, .source-footer { padding-left: 20px; padding-right: 20px; }
}

@media (max-width: 720px) {
  .app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
  }
  .map-column {
    order: 1;
    min-height: 0;
    height: 51vh;
  }
  .sidebar {
    order: 2;
    min-height: auto;
    max-height: none;
    overflow: visible;
    border-right: 0;
    box-shadow: 0 -14px 42px rgba(23, 43, 51, .12);
  }
  .map-header { top: 12px; right: 12px; left: 12px; }
  .map-stamp { padding: 10px 12px; }
  .map-stamp strong { font-size: 16px; }
  .map-actions { gap: 5px; }
  .map-action { min-height: 35px; padding: 0 9px; }
  .map-action span { display: none; }
  .map-legend { right: 12px; bottom: 14px; padding: 8px 9px; gap: 7px; }
  .leaflet-control-zoom { margin-top: 72px !important; margin-left: 12px !important; }
  .brand-bar { padding-top: 17px; }
  .hero { padding-bottom: 20px; }
  .hero h1 { font-size: clamp(37px, 11vw, 56px); }
  .controls { padding-top: 15px; }
  .results-head { padding-top: 14px; }
  .source-footer { margin-top: 0; }
  .toast { right: 14px; bottom: 14px; left: 14px; max-width: none; }
}

@media (max-width: 400px) {
  .filter-grid { grid-template-columns: 1fr; }
  .compact-button { width: 100%; }
  .check-row { align-items: flex-start; flex-direction: column; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
