:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f7f8f4;
  color: #1f2a24;
  --surface: rgba(255, 255, 252, 0.96);
  --surface-solid: #fffffc;
  --ink: #1f2a24;
  --muted: #66736b;
  --line: #dfe5df;
  --accent: #176b52;
  --accent-soft: #e8f4ef;
  --danger-soft: #fff0ef;
  --shadow: 0 18px 50px rgba(31, 42, 36, 0.16);
}

* {
  box-sizing: border-box;
}

html,
body,
.app-shell {
  width: 100%;
  min-width: 320px;
  height: 100%;
  min-height: 100dvh;
  margin: 0;
}

body {
  overflow: hidden;
}

button,
select,
a {
  font: inherit;
}

button,
select {
  color: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  position: relative;
  background: #e7ede8;
}

#map {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.topbar {
  position: absolute;
  z-index: 800;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: max(16px, env(safe-area-inset-top)) 16px 0;
  pointer-events: none;
}

.topbar > * {
  pointer-events: auto;
}

.topbar > div {
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(31, 42, 36, 0.1);
}

.eyebrow,
.topbar h1,
.result-title,
.status-text {
  margin: 0;
}

.eyebrow {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.topbar h1 {
  margin-top: 2px;
  font-size: 22px;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.location-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 16px;
  background: var(--surface-solid);
  box-shadow: 0 8px 24px rgba(31, 42, 36, 0.1);
  font-weight: 800;
}

.location-button span:first-child {
  color: var(--accent);
  font-size: 20px;
}

.sheet {
  position: absolute;
  z-index: 900;
  left: 12px;
  right: 12px;
  bottom: max(12px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  max-height: min(52dvh, 520px);
  padding: 10px 12px 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.sheet-handle {
  width: 36px;
  height: 4px;
  margin: 0 auto 10px;
  border-radius: 99px;
  background: #c8d0ca;
}

.category-strip {
  display: flex;
  gap: 8px;
  margin: 0 -2px 12px;
  padding: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}

.category-strip::-webkit-scrollbar {
  display: none;
}

.category-button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.category-button[aria-pressed="true"] {
  border-color: #b9d7ca;
  background: var(--accent-soft);
  color: var(--accent);
}

.sheet-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px 10px;
}

.result-title {
  font-size: 16px;
  font-weight: 850;
  letter-spacing: -0.02em;
}

.status-text {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.radius-control {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.radius-control select {
  min-height: 34px;
  padding: 0 28px 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-size: 12px;
  font-weight: 800;
}

.results {
  display: grid;
  gap: 8px;
  min-height: 74px;
  padding: 2px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.empty-state,
.loading-state,
.error-state {
  display: grid;
  place-items: center;
  min-height: 72px;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.error-state {
  background: var(--danger-soft);
  color: #85413d;
}

.result-card {
  content-visibility: auto;
  contain-intrinsic-size: 104px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  overflow: hidden;
}

.result-main {
  display: flex;
  width: 100%;
  gap: 10px;
  padding: 12px;
  border: 0;
  background: transparent;
  text-align: left;
}

.result-icon {
  display: grid;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 19px;
  font-weight: 900;
}

.result-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.result-name {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-meta,
.result-address {
  color: var(--muted);
  font-size: 12px;
}

.result-address {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px 10px;
}

.favorite-button,
.directions-link,
.phone-link {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fafbf9;
  color: var(--ink);
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
}

.favorite-button {
  width: 38px;
}

.favorite-button.is-favorite {
  color: #9a6b00;
}

.directions-link,
.phone-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
}

.sheet-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 2px 0;
  color: #7d8981;
  font-size: 9px;
}

.place-marker {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 3px solid #fff;
  border-radius: 12px;
  background: #176b52;
  box-shadow: 0 6px 14px rgba(31, 42, 36, 0.24);
  color: #fff;
  font-size: 15px;
  font-weight: 900;
}

.leaflet-control-attribution {
  margin-bottom: 214px !important;
  font-size: 9px !important;
}

@media (min-width: 760px) {
  .topbar {
    padding: 24px;
  }

  .sheet {
    left: 24px;
    right: auto;
    bottom: 24px;
    width: min(430px, calc(100vw - 48px));
    max-height: calc(100dvh - 150px);
  }

  .topbar > div,
  .sheet {
    backdrop-filter: blur(12px);
  }

  .leaflet-control-attribution {
    margin-bottom: 0 !important;
  }
}
