:root {
  --bg: #07120d;
  --bg-soft: #0d1b14;
  --panel: #fff9e8;
  --panel-strong: #ffffff;
  --panel-muted: #eee7d2;
  --ink: #0e0f0c;
  --muted: #4a5648;
  --green: #9fe870;
  --green-deep: #163300;
  --yellow: #ffd166;
  --blue: #82b7ff;
  --gray: #d7d0bf;
  --danger: #d94f4f;
  --warn-bg: #fff1d3;
  --warn-ink: #5a1c00;
  --ring: rgba(159, 232, 112, 0.42);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
  --divider: rgba(14, 15, 12, 0.09);
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-feature-settings: "calt";
  background:
    radial-gradient(circle at 20% -10%, rgba(159, 232, 112, 0.18), transparent 34rem),
    linear-gradient(160deg, var(--bg), #030604 72%);
  color: var(--panel);
}

button, a.button {
  border: 0;
  border-radius: 999px;
  padding: 0.92rem 1.12rem;
  min-height: 48px;
  font-weight: 900;
  color: var(--green-deep);
  background: var(--green);
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  box-shadow: 0 0 0 1px rgba(159, 232, 112, 0.18), 0 12px 34px rgba(159, 232, 112, 0.18);
  transition: transform 140ms ease, box-shadow 140ms ease, opacity 140ms ease;
}

button:hover, a.button:hover { transform: translateY(-1px) scale(1.02); }
button:active, a.button:active { transform: scale(0.98); }
button.secondary, a.button.secondary {
  background: rgba(255, 249, 232, 0.18);
  color: var(--panel);
  box-shadow: inset 0 0 0 1px rgba(255, 249, 232, 0.32);
}
button:disabled { opacity: 0.55; cursor: wait; }
button:focus-visible, a:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 3px;
}

.app-shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  min-height: 100vh;
  padding: clamp(0.8rem, 2vw, 1.4rem);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: clamp(1rem, 4vw, 2rem);
  padding: 0.35rem 0 1rem;
}

.hero-copy { min-width: 0; }

.eyebrow {
  margin: 0 0 0.55rem;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow span { filter: drop-shadow(0 0 10px rgba(159, 232, 112, 0.9)); }

h1 {
  max-width: 12ch;
  margin: 0;
  font-size: clamp(2.4rem, 8vw, 5.8rem);
  line-height: 0.86;
  letter-spacing: -0.07em;
  text-wrap: balance;
}

.hero-subtitle {
  max-width: 48rem;
  margin: 0.9rem 0 0;
  color: rgba(255, 249, 232, 0.86);
  font-size: clamp(1rem, 2vw, 1.16rem);
  line-height: 1.45;
  font-weight: 650;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.9rem;
}

.summary-pill, .freshness-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border-radius: 999px;
  padding: 0.42rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 900;
  color: var(--panel);
  background: rgba(255, 249, 232, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 249, 232, 0.18);
}

.summary-pill.good { color: var(--green-deep); background: var(--green); }
.summary-pill.warn { color: var(--ink); background: var(--yellow); }
.freshness-pill::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  margin-right: 0.45rem;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 14px rgba(159, 232, 112, 0.8);
}

.actions {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  min-width: 18rem;
}

.map-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 249, 232, 0.18);
  border-radius: clamp(24px, 4vw, 38px);
  box-shadow: var(--shadow);
  background: #162016;
}

.map-toolbar {
  position: absolute;
  z-index: 700;
  top: 0.8rem;
  left: 0.8rem;
  right: 0.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  pointer-events: none;
}

.map-toolbar span {
  border-radius: 999px;
  padding: 0.38rem 0.62rem;
  color: var(--green-deep);
  background: rgba(159, 232, 112, 0.92);
  font-size: 0.78rem;
  font-weight: 950;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}

#map {
  height: min(50vh, 500px);
  min-height: 340px;
  width: 100%;
  background: #dfe6d4;
}

.leaflet-control-zoom a { font-weight: 900; }
.leaflet-container { font-family: inherit; }
.leaflet-control-attribution { font-size: 10px; }
.food-dot {
  filter: drop-shadow(0 2px 7px rgba(0, 0, 0, 0.35));
}

.icon {
  display: inline-block;
  width: 14px;
  height: 14px;
  vertical-align: -2px;
  flex-shrink: 0;
}
.icon svg { display: block; width: 100%; height: 100%; }

.food-marker {
  background: transparent !important;
  border: 0 !important;
}
.food-pin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--green);
  color: var(--green-deep);
  border: 2px solid var(--green-deep);
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.35);
}
.food-pin svg { width: 12px; height: 12px; }

.results-panel {
  margin-top: 1rem;
  display: grid;
  gap: 1rem;
}

.results-panel > div {
  display: grid;
  gap: 1rem;
}

.status, .meta {
  color: rgba(255, 249, 232, 0.92);
  font-size: 0.98rem;
  line-height: 1.45;
  font-weight: 650;
}
.status.warn { color: #ffe3a3; }
.status.error { color: #ffb4b4; }

.card, .list-card, .safety-note {
  background: var(--panel);
  color: var(--ink);
  border-radius: 30px;
  padding: clamp(1.25rem, 3.2vw, 1.75rem);
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(14, 15, 12, 0.08);
}

.card.best {
  position: relative;
  overflow: hidden;
  border: 3px solid var(--green);
}
.card.best::after {
  content: "";
  position: absolute;
  inset: -30% -20% auto auto;
  width: 14rem;
  height: 14rem;
  border-radius: 50%;
  background: rgba(159, 232, 112, 0.22);
  pointer-events: none;
}
.card.best > * { position: relative; z-index: 1; }

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.42rem 0.78rem;
  font-weight: 950;
  font-size: 0.78rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  background: var(--gray);
}
.badge.go_now, .badge.leaving_soon { background: var(--green); color: var(--green-deep); }
.badge.next_best, .badge.reliable_fallback { background: var(--yellow); }
.badge.evening_nearby { background: var(--blue); }
.badge.call_first { background: var(--danger); color: white; }
.badge.verify_listed { background: var(--panel-muted); }

.card-kicker, .section-label {
  margin: 0.85rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 950;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.card h2, .list-card h2 {
  margin: 0.5rem 0 0.55rem;
  font-size: clamp(1.85rem, 6vw, 3.15rem);
  line-height: 0.95;
  letter-spacing: -0.055em;
  text-wrap: pretty;
  overflow-wrap: anywhere;
}

.list-card h2 { font-size: clamp(1.4rem, 4vw, 2rem); }
.card p, .list-card p { margin: 0.4rem 0; }
.address, .option-address {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--ink);
}
.option-address {
  display: block;
  margin: 0.25rem 0 0.6rem;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.detail { color: var(--muted); font-weight: 750; line-height: 1.45; font-size: 1.02rem; }

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 1.1rem 0 0.4rem;
}
.metric {
  min-width: 0;
  border-radius: 18px;
  padding: 0.85rem 0.85rem;
  background: rgba(14, 15, 12, 0.06);
}
.metric.metric-emphasize {
  background: rgba(22, 51, 0, 0.08);
  box-shadow: inset 0 0 0 1.5px rgba(22, 51, 0, 0.18);
}
.metric-label {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 950;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.metric strong {
  display: block;
  margin-top: 0.35rem;
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  line-height: 1.15;
  font-weight: 900;
  color: var(--ink);
}
.metric.metric-emphasize strong { color: var(--green-deep); }

.restrictions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0.85rem 0 0.2rem;
}
.restriction-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.restriction-note {
  margin: 0;
  padding: 0;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.005em;
  line-height: 1.35;
}
.restriction-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.8rem 0.5rem 0.65rem;
  border-radius: 6px;
  background: var(--warn-bg);
  color: var(--warn-ink);
  font-weight: 900;
  font-size: 0.92rem;
  line-height: 1.1;
  border-left: 4px solid var(--warn-ink);
  box-shadow: inset 0 0 0 1.5px rgba(90, 28, 0, 0.22);
}
.restriction-icon {
  font-size: 1.05rem;
  line-height: 1;
  flex-shrink: 0;
}
.restriction-label {
  letter-spacing: 0.01em;
  text-transform: uppercase;
  font-size: 0.82rem;
}

.card-actions {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-top: 1.1rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--divider);
}
.card-actions a { flex: 1 1 12rem; }

.option {
  display: block;
  padding: 1.1rem 0;
  border-top: 1px solid var(--divider);
}
.option:first-of-type { border-top: 0; padding-top: 0.4rem; }
.option-name {
  display: block;
  font-size: 1.18rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
  color: var(--ink);
}
.option .metrics { margin: 0.7rem 0 0.2rem; }
.option .restrictions { margin: 0.6rem 0 0.2rem; }

.option a, .inline-route { color: var(--ink); font-weight: 950; }
.option-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.85rem;
}
.option-actions .inline-route { margin-top: 0; }
.inline-route {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-width: 9rem;
  min-height: 44px;
  margin-top: 0.85rem;
  padding: 0.72rem 0.95rem;
  color: var(--green-deep);
  background: var(--green);
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(22, 51, 0, 0.08);
  text-decoration: none;
}
.inline-route.secondary {
  color: var(--ink);
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--ink);
}

.safety-note {
  margin: 1rem 0 0.35rem;
  background: rgba(255, 249, 232, 0.1);
  color: rgba(255, 249, 232, 0.92);
  border: 1px solid rgba(255, 249, 232, 0.18);
  box-shadow: none;
  font-size: 0.98rem;
  line-height: 1.5;
}
.safety-note strong { color: var(--green); }

.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  margin: 0.8rem 0 0;
  padding: 0.2rem 0.15rem 0.4rem;
  color: rgba(255, 249, 232, 0.66);
  font-size: 0.82rem;
  line-height: 1.45;
  font-weight: 700;
}
.site-footer a {
  color: rgba(255, 249, 232, 0.92);
  font-weight: 950;
  text-decoration-color: rgba(159, 232, 112, 0.7);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.22em;
}
.site-footer a:hover { color: var(--green); }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; align-items: stretch; }
  .actions { justify-content: stretch; min-width: 0; }
  .actions button { flex: 1 1 12rem; }
  h1 { max-width: 10ch; }
}

@media (max-width: 720px) {
  .app-shell { padding: 0.75rem; }
  .hero { gap: 0.9rem; }
  h1 {
    max-width: none;
    font-size: clamp(2.1rem, 9vw, 3rem);
    line-height: 0.9;
  }
  .hero-subtitle { font-size: 0.95rem; margin-top: 0.65rem; }
  .actions { display: grid; grid-template-columns: 1fr 1fr; }
  button, a.button { padding-inline: 0.75rem; }
  #map { height: 44vh; min-height: 300px; }
  .map-panel, .card, .list-card, .safety-note { border-radius: 24px; }
  .map-toolbar { top: 0.65rem; left: 0.65rem; right: 0.65rem; }
  .map-toolbar span { font-size: 0.76rem; padding: 0.36rem 0.58rem; }
  .leaflet-control-zoom a { width: 36px; height: 36px; line-height: 36px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
  .card-actions { display: grid; grid-template-columns: 1fr; }
  .site-footer { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 420px) {
  .app-shell { padding: 0.65rem; }
  .eyebrow { font-size: 0.7rem; margin-bottom: 0.4rem; }
  h1 { letter-spacing: -0.055em; font-size: clamp(1.95rem, 9vw, 2.55rem); }
  .hero-subtitle { font-size: 0.88rem; }
  .hero-meta { gap: 0.4rem; }
  .summary-pill, .freshness-pill { width: 100%; justify-content: center; }
  .actions { grid-template-columns: 1fr; }
  #map { min-height: 285px; height: 42vh; }
  .metrics { gap: 0.5rem; }
  .metric { padding: 0.7rem; }
  .restriction-pill { font-size: 0.88rem; padding: 0.45rem 0.7rem 0.45rem 0.55rem; }
  .restriction-label { font-size: 0.78rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
