:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --panel-strong: #f9fafb;
  --ink: #172026;
  --muted: #64707d;
  --line: #d9e0e7;
  --accent: #0f766e;
  --accent-strong: #0b5f59;
  --shadow: 0 18px 50px rgba(23, 32, 38, 0.12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.45;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: 20px;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding: 6px 2px 18px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  line-height: 1;
}

h2 {
  font-size: 1.25rem;
}

.result-count {
  display: grid;
  min-width: 88px;
  justify-items: end;
  color: var(--muted);
  font-size: 0.9rem;
}

.result-count strong {
  color: var(--ink);
  font-size: 2rem;
  line-height: 1;
}

.map-band,
.table-band {
  width: 100%;
}

.filter-grid {
  display: grid;
  grid-template-columns: minmax(240px, 1.4fr) repeat(5, minmax(150px, 1fr)) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}

.filter-control {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.filter-control span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.filter-control input,
.filter-control select,
.reset-button {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--ink);
}

.filter-control input,
.filter-control select {
  padding: 0 12px;
}

.filter-control input:focus,
.filter-control select:focus,
.reset-button:focus-visible,
tbody tr:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.24);
  outline-offset: 2px;
}

.reset-button {
  padding: 0 14px;
  cursor: pointer;
  font-weight: 800;
}

.reset-button:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.map-layout {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

.map-sidebar {
  display: flex;
  min-height: 420px;
  max-height: min(66vh, 670px);
  overflow: hidden;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 12px 30px rgba(23, 32, 38, 0.08);
}

.sidebar-heading {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.sidebar-heading h2 {
  font-size: 1rem;
}

.sidebar-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.in-view-list {
  overflow: auto;
  padding: 8px;
}

.in-view-card {
  display: block;
  width: 100%;
  margin: 0 0 8px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafc;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.in-view-card:hover,
.in-view-card:focus-visible {
  border-color: rgba(15, 118, 110, 0.45);
  background: #f4fbf9;
}

.in-view-name {
  display: block;
  font-weight: 850;
}

.in-view-meta {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
}

.in-view-empty {
  margin: 0;
  padding: 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.map-wrap {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

#map {
  min-height: 420px;
  height: min(66vh, 670px);
  width: 100%;
  z-index: 1;
}

.legend {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 500;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
  max-width: min(560px, calc(100% - 24px));
  padding: 8px;
  border: 1px solid rgba(217, 224, 231, 0.94);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 28px rgba(23, 32, 38, 0.14);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
  white-space: nowrap;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--dot);
  box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(23, 32, 38, 0.16);
}

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

.marker-pin {
  display: block;
  width: 22px;
  height: 22px;
  border: 3px solid #fff;
  border-radius: 999px 999px 999px 3px;
  background: var(--marker-color);
  box-shadow: 0 5px 15px rgba(23, 32, 38, 0.28);
  transform: rotate(-45deg);
}

.marker-pin::after {
  position: absolute;
  inset: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  content: "";
}

.custom-cluster {
  display: grid;
  border: 3px solid #fff;
  border-radius: 999px;
  background: #2563eb;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.34);
  color: #fff;
  font-weight: 850;
  place-items: center;
}

.custom-cluster span {
  line-height: 1;
}

.leaflet-popup-content {
  min-width: 230px;
  margin: 14px;
}

.popup-title {
  margin: 0 0 8px;
  font-size: 1rem;
}

.popup-meta {
  display: grid;
  gap: 4px;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.popup-notes {
  margin: 0 0 12px;
}

.map-link,
.table-link {
  color: var(--accent-strong);
  font-weight: 800;
  text-decoration: none;
}

.map-link:hover,
.table-link:hover {
  text-decoration: underline;
}

.table-band {
  padding-top: 24px;
}

.table-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 0 2px 10px;
}

.table-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 12px 30px rgba(23, 32, 38, 0.08);
}

.mobile-card-list {
  display: none;
}

table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--panel-strong);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover {
  background: #f5fbfa;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.name-cell {
  min-width: 190px;
  font-weight: 850;
}

.category-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 24px;
  white-space: nowrap;
}

.category-pill::before {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--dot);
  content: "";
}

.notes-cell {
  min-width: 260px;
  max-width: 420px;
  color: var(--muted);
}

.unpinned-note {
  display: block;
  margin-top: 4px;
  color: #a15c00;
  font-size: 0.78rem;
  font-weight: 750;
}

.mobile-restaurant-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 8px 22px rgba(23, 32, 38, 0.07);
  cursor: pointer;
}

.mobile-restaurant-card:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.24);
  outline-offset: 2px;
}

.mobile-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.mobile-card-head h3 {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.2;
  letter-spacing: 0;
}

.mobile-price {
  color: #2f3c47;
  font-size: 0.82rem;
  font-weight: 850;
  white-space: nowrap;
}

.mobile-meta {
  margin: 6px 0 0;
  color: #4f5b66;
  font-size: 0.86rem;
  line-height: 1.35;
}

.mobile-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.source-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  max-width: 100%;
  padding: 0 8px;
  border-radius: 999px;
  background: #e5f3f1;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
}

.mobile-notes {
  display: -webkit-box;
  margin: 10px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.42;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.mobile-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.mobile-map-button,
.mobile-google-link {
  display: inline-grid;
  min-height: 38px;
  place-items: center;
  border: 1px solid #bfcbd4;
  border-radius: var(--radius);
  background: #fff;
  color: #24313b;
  font-size: 0.84rem;
  font-weight: 850;
  text-align: center;
  text-decoration: none;
}

.mobile-map-button {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

.mobile-map-button:disabled {
  border-color: var(--line);
  background: #eef2f4;
  color: var(--muted);
  cursor: default;
}

.mobile-google-link:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.site-footer {
  padding: 18px 2px 4px;
  color: var(--muted);
  font-size: 0.82rem;
}

@media (max-width: 1200px) {
  .filter-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .search-control {
    grid-column: 1 / -1;
  }

  .map-layout {
    grid-template-columns: minmax(230px, 300px) minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 12px;
  }

  .topbar,
  .table-heading {
    align-items: start;
    flex-direction: column;
    gap: 10px;
  }

  .result-count {
    justify-items: start;
  }

  .filter-grid {
    grid-template-columns: 1fr;
  }

  .map-layout {
    grid-template-columns: 1fr;
  }

  .map-wrap {
    order: 1;
  }

  .map-sidebar {
    order: 2;
    min-height: 260px;
    max-height: 360px;
  }

  #map {
    min-height: 340px;
    height: 58vh;
  }

  .legend {
    left: 8px;
    right: 8px;
    bottom: 8px;
    justify-content: flex-start;
  }

  th,
  td {
    padding: 10px 12px;
  }

  .table-wrap {
    display: none;
  }

  .mobile-card-list {
    display: grid;
    gap: 10px;
  }

  .mobile-restaurant-card {
    padding: 12px;
  }
}
