:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --panel: #ffffff;
  --ink: #1c1f1d;
  --muted: #626a64;
  --line: #d9ded6;
  --green: #1f8a5b;
  --amber: #bd7a11;
  --red: #be3b33;
  --teal: #237c90;
  --shadow: 0 18px 48px rgba(28, 31, 29, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

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

button,
input,
select {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width, minmax(360px, 440px)) minmax(0, 1fr);
  width: 100%;
  height: 100vh;
  min-height: 620px;
  overflow-x: hidden;
}

.sidebar {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  border-right: 1px solid var(--line);
  background: var(--panel);
}

.preview-status {
  padding: 10px 12px;
  border: 1px solid #c9dce0;
  border-radius: 8px;
  background: #eef7f8;
  color: #225769;
  font-size: 13px;
  line-height: 1.35;
}

.preview-link {
  margin: 6px 0 0;
  font-size: 13px;
}

.preview-link a {
  color: var(--teal);
}

.area-field {
  flex: 0 0 auto;
}

.header {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  margin: 0 0 4px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.3px;
  text-decoration: none;
}

.wordmark span {
  color: var(--green);
}

.wordmark svg {
  margin-right: 5px;
}

.disclaimer a {
  color: inherit;
  text-underline-offset: 2px;
}

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

h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.05;
}

.data-updated,
.disclaimer {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.data-updated + .disclaimer {
  margin-top: 2px;
  text-wrap: balance;
}

.primary-button {
  min-height: 40px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 6px;
  padding: 0 14px;
  background: var(--ink);
  color: #ffffff;
  cursor: pointer;
  font-weight: 700;
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.status-row {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.stats-grid div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: #fbfcfa;
}

.stat-value,
.stat-label {
  display: block;
}

.stat-value {
  overflow: hidden;
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-label {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.filters {
  display: grid;
  grid-template-columns: 1fr 150px;
  gap: 10px;
  min-width: 0;
}

.field {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.field input,
.field select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  background: #ffffff;
  color: var(--ink);
  font-size: 14px;
  transition:
    border-color 120ms ease,
    box-shadow 120ms ease;
}

.field select,
.combobox input {
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23626a64' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: right 12px center;
  background-repeat: no-repeat;
  background-size: 12px 8px;
  text-overflow: ellipsis;
}

.field select {
  appearance: none;
  overflow: hidden;
  cursor: pointer;
  white-space: nowrap;
}

.combobox {
  position: relative;
  min-width: 0;
}

.combobox input:disabled {
  cursor: progress;
  opacity: 0.7;
}

.combobox-list {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  left: 0;
  z-index: 20;
  max-height: 320px;
  margin: 0;
  padding: 4px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
  list-style: none;
}

.combobox-option {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 34px;
  padding: 0 8px;
  border-radius: 5px;
  color: var(--ink);
  cursor: pointer;
  font-size: 14px;
}

.combobox-option.is-active {
  background: #eef4ef;
}

.combobox-code {
  font-weight: 800;
}

.combobox-option[aria-selected="true"] .combobox-code {
  color: var(--green);
}

.combobox-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.combobox-count {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.combobox-empty {
  padding: 8px;
  color: var(--muted);
  font-size: 13px;
}

.field input:hover,
.field select:hover {
  border-color: #c3cac1;
}

.field input:focus,
.field select:focus {
  border-color: var(--green);
  outline: none;
  box-shadow: 0 0 0 3px rgba(31, 138, 91, 0.16);
}

.field input::placeholder {
  color: #8a918b;
}

.toggles {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.toggles label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  color: var(--ink);
  font-size: 13px;
}

.toggles input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--green);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: var(--muted);
  font-size: 12px;
}

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

.legend-swatch {
  width: 11px;
  height: 11px;
  border-radius: 999px;
}

.legend-swatch.high {
  background: var(--green);
}

.legend-swatch.mid {
  background: var(--amber);
}

.legend-swatch.low,
.legend-swatch.bad {
  background: var(--red);
}

.list-summary {
  flex: 0 0 auto;
  margin: -4px 0 -8px;
  color: var(--muted);
  font-size: 12px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid #bcd9c8;
  border-radius: 999px;
  padding: 1px 6px 1px 9px;
  background: #eef4ef;
  color: #245c3d;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.filter-chip::after {
  font-size: 14px;
  line-height: 1;
  content: "\00d7";
}

.filter-chip:hover {
  border-color: var(--green);
}

.filter-chip:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.restaurant-list {
  display: grid;
  min-height: 0;
  gap: 8px;
  margin: 0;
  padding: 0 2px 2px;
  overflow: auto;
  list-style: none;
}

.restaurant-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 1px 0 rgba(28, 31, 29, 0.04);
}

.restaurant-card.selected {
  border-color: var(--teal);
  box-shadow: 0 0 0 2px rgba(35, 124, 144, 0.18);
}

.restaurant-button {
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 12px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

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

.restaurant-name {
  overflow-wrap: anywhere;
  font-weight: 800;
  line-height: 1.2;
}

.score-pill {
  min-width: 58px;
  border-radius: 6px;
  padding: 5px 8px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.score-pill.high {
  background: var(--green);
}

.score-pill.mid {
  background: var(--amber);
}

.score-pill.low,
.score-pill.bad {
  background: var(--red);
}

.meta-line,
.detail-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.detail-line strong {
  color: var(--ink);
}

.badge {
  border-radius: 999px;
  padding: 2px 7px;
  background: #eef4ef;
  color: #245c3d;
  font-weight: 700;
}

.badge.warning {
  background: #f8e8e5;
  color: #943129;
}

.map-panel {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.app-shell.is-sidebar-collapsed {
  grid-template-columns: minmax(0, 1fr);
}

.app-shell.is-sidebar-collapsed .sidebar {
  display: none;
}

.sidebar-resizer {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 1000;
  width: 8px;
  cursor: col-resize;
  touch-action: none;
}

.sidebar-resizer::after {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
  background: var(--green);
  content: "";
  opacity: 0;
  transition: opacity 120ms ease;
}

.sidebar-resizer:hover::after,
.sidebar-resizer:focus-visible::after,
.is-resizing-sidebar .sidebar-resizer::after {
  opacity: 1;
}

.sidebar-resizer:focus-visible {
  outline: none;
}

.app-shell.is-sidebar-collapsed .sidebar-resizer {
  display: none;
}

.is-resizing-sidebar {
  cursor: col-resize;
  user-select: none;
}

.sidebar-toggle {
  position: absolute;
  top: 50%;
  left: 0;
  z-index: 1001;
  display: grid;
  width: 22px;
  height: 52px;
  place-items: center;
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 0 8px 8px 0;
  padding: 0;
  background: #ffffff;
  box-shadow: 0 2px 9px rgba(28, 31, 29, 0.16);
  color: var(--muted);
  cursor: pointer;
  transform: translateY(-50%);
}

.sidebar-toggle::before {
  width: 7px;
  height: 7px;
  border-bottom: 2px solid currentColor;
  border-left: 2px solid currentColor;
  margin-left: 3px;
  content: "";
  transform: rotate(45deg);
}

.app-shell.is-sidebar-collapsed .sidebar-toggle::before {
  margin-left: -3px;
  transform: rotate(-135deg);
}

.sidebar-toggle:hover {
  color: var(--ink);
}

.sidebar-toggle:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.map {
  width: 100%;
  height: 100%;
  background: #e4ebe6;
}

.marker-pin {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 3px solid #ffffff;
  border-radius: 999px 999px 999px 4px;
  box-shadow: var(--shadow);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  transform: rotate(-45deg);
}

.marker-pin span {
  transform: rotate(45deg);
}

.marker-pin.high {
  background: var(--green);
}

.marker-pin.mid {
  background: var(--amber);
}

.marker-pin.low,
.marker-pin.bad {
  background: var(--red);
}

.marker-pin.user {
  background: var(--teal);
}

.restaurant-cluster {
  display: grid !important;
  place-items: center;
  border-radius: 50%;
  background: rgba(35, 124, 144, 0.2);
}

.restaurant-cluster span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 2px solid #ffffff;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 2px 9px rgba(28, 31, 29, 0.22);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
}

.area-marker {
  display: grid !important;
  align-content: center;
  justify-items: center;
  border: 2px solid #fff;
  border-radius: 18px;
  background: #237c90;
  box-shadow: 0 2px 12px rgba(28, 31, 29, .3);
  color: #fff;
  line-height: 1.1;
  cursor: pointer;
}

.area-marker span { font-size: 12px; font-weight: 800; }
.area-marker strong { font-size: 12px; }

.area-cluster {
  display: grid !important;
  place-items: center;
  border-radius: 50%;
  background: rgba(35, 124, 144, .22);
}

.area-cluster span {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #237c90;
  box-shadow: 0 2px 9px rgba(28, 31, 29, .22);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
}

.popup {
  min-width: 220px;
}

.popup h2 {
  margin: 0 0 6px;
  font-size: 16px;
  line-height: 1.2;
}

.popup p {
  margin: 5px 0;
  color: var(--muted);
}

.popup strong {
  color: var(--ink);
}

.popup-share {
  min-height: 30px;
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
}

.popup-share:hover {
  border-color: var(--green);
}

.popup-share-link {
  width: 100%;
  min-height: 30px;
  margin-top: 6px;
  border: 1px solid var(--green);
  border-radius: 6px;
  padding: 0 8px;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
}

.fallback-map {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 480px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(28, 31, 29, 0.07) 1px, transparent 1px),
    linear-gradient(rgba(28, 31, 29, 0.07) 1px, transparent 1px),
    #e4ebe6;
  background-size: 56px 56px;
}

.fallback-note {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 2;
  max-width: 360px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--muted);
  font-size: 13px;
  box-shadow: var(--shadow);
}

.fallback-pin {
  position: absolute;
  width: 28px;
  height: 28px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  box-shadow: var(--shadow);
  color: #ffffff;
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
  transform: translate(-50%, -50%);
}

.fallback-pin.high {
  background: var(--green);
}

.fallback-pin.mid {
  background: var(--amber);
}

.fallback-pin.low,
.fallback-pin.bad {
  background: var(--red);
}

.fallback-pin.user {
  background: var(--teal);
}

@media (max-width: 900px) {
  .sidebar-resizer,
  .sidebar-toggle {
    display: none;
  }

  .app-shell.is-sidebar-collapsed .sidebar {
    display: flex;
  }

  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(440px, 54vh) minmax(420px, 46vh);
    height: auto;
    min-height: 100vh;
  }

  .sidebar {
    order: 2;
    border-top: 1px solid var(--line);
    border-right: 0;
  }

  .map-panel {
    order: 1;
  }
}

@media (max-width: 520px) {
  .app-shell {
    grid-template-rows: 48vh auto;
  }

  /* iOS zooms into fields with text smaller than 16px. */
  .field input,
  .field select {
    font-size: 16px;
  }

  .sidebar {
    padding: 14px;
  }

  .header {
    display: grid;
    gap: 12px;
  }

  .primary-button {
    width: 100%;
  }

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

  .filters,
  .toggles {
    grid-template-columns: 1fr;
  }

  .restaurant-main {
    grid-template-columns: minmax(0, 1fr);
  }

  .score-pill {
    width: max-content;
  }
}

.site-overview {
  padding: 28px 32px 22px;
  background: #edf3ed;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(480px, 1.4fr);
  gap: 18px 36px;
}
.overview-heading h2 { margin: 0; font-size: 28px; letter-spacing: -0.6px; }
.overview-heading > p:last-child, .overview-note { color: var(--muted); font-size: 13px; line-height: 1.5; margin: 8px 0 0; }
.overview-totals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 0; align-items: center; }
.overview-totals div { display: flex; flex-direction: column-reverse; gap: 5px; }
.overview-totals dt { color: var(--muted); font-size: 13px; }
.overview-totals dd { font-size: clamp(24px, 2.6vw, 38px); font-weight: 750; letter-spacing: -1px; margin: 0; }
.overview-note { grid-column: 1 / -1; }
.overview-answer { grid-column: 1 / -1; max-width: 980px; margin: 14px 0 0; color: var(--ink); font-size: 15px; line-height: 1.55; }
@media (max-width: 900px) {
  .site-overview { grid-template-columns: 1fr; padding: 24px 20px; }
  .overview-totals { gap: 12px; }
}
@media (max-width: 420px) {
  .overview-totals dd { font-size: 22px; letter-spacing: -0.6px; }
  .overview-totals dt { font-size: 12px; }
}

.top-list { padding: 36px 32px 8px; border-top: 1px solid var(--line); background: var(--panel); }
.top-list h2 { margin: 0 0 4px; font-size: 26px; }
.top-list ol { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 32px; margin: 20px 0 24px; padding-left: 24px; }
.top-list li { padding: 8px 0; }
.top-list li a { color: var(--ink); font-weight: 700; text-decoration: none; }
.top-list li a:hover { color: var(--green); text-decoration: underline; }
.top-list li span { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.top-list p a { color: var(--ink); }
@media (max-width: 700px) { .top-list { padding: 28px 20px 4px; } .top-list ol { grid-template-columns: 1fr; } }
.site-footer { padding: 36px 32px; border-top: 1px solid var(--line); background: var(--panel); }
.footer-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.footer-heading h2 { margin: 0; font-size: 26px; }
.site-footer a { color: var(--ink); text-decoration: none; }
.site-footer a:hover { color: var(--green); text-decoration: underline; }
.site-footer a:focus-visible { outline: 2px solid var(--green); outline-offset: 4px; }
.country-links { display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0 28px; }
.country-links a { border: 1px solid var(--line); border-radius: 6px; padding: 10px 16px; }
.footer-note { color: var(--muted); font-size: 13px; line-height: 1.6; }
.area-directory { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px 24px; margin: 24px 0 32px; }
.area-directory a { padding: 8px 0; font-size: 14px; }
.area-directory span { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
@media (max-width: 1000px) { .area-directory { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px) {
  .site-footer { padding: 28px 20px; }
  .area-directory { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; }
  .footer-heading { align-items: flex-start; }
  .footer-heading > a { font-size: 13px; }
}
@media (max-width: 520px) {
  .overview-totals { grid-template-columns: 1fr; gap: 12px; }
  .overview-totals div { flex-direction: row; justify-content: space-between; align-items: baseline; }
  .overview-totals dd { font-size: 26px; }
}

.restaurant-profile-link { display: inline-block; margin: 0 14px 12px; color: #237c58; font-size: 13px; }
