:root {
  color-scheme: dark;
  --bg: #111512;
  --panel: #1a201c;
  --panel-soft: #202720;
  --ink: #f1f3ed;
  --muted: #a7b0a7;
  --line: #384139;
  --accent: #8fc7a3;
  --accent-strong: #b7dfc4;
  --warm: #d89a6a;
  --blue: #9bb8d4;
  --green-soft: #26362b;
  --orange-soft: #3a2d25;
  --blue-soft: #23313c;
  --shadow: 0 18px 55px rgba(0, 0, 0, 0.36);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(13, 16, 14, 0.84), rgba(17, 21, 18, 0.94)),
    url("https://images.unsplash.com/photo-1500530855697-b586d89ba3ee?auto=format&fit=crop&w=2200&q=80")
      center/cover fixed;
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

.shell {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 22px;
  min-height: 100vh;
  padding: 24px;
}

.search-panel,
.results-panel {
  background: rgba(26, 32, 28, 0.92);
  border: 1px solid rgba(74, 86, 76, 0.74);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.search-panel {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 20px;
  min-height: calc(100vh - 48px);
  padding: 28px 32px;
  border-radius: 8px;
}

.results-panel {
  overflow: hidden;
  min-height: calc(100vh - 48px);
  border-radius: 8px;
}

.eyebrow,
.label {
  margin: 0;
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 13ch;
  margin-bottom: 14px;
  font-size: clamp(2.2rem, 4.4vw, 3.35rem);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1.25rem;
}

h3 {
  margin-bottom: 12px;
  font-size: 1rem;
}

.intro {
  max-width: 38rem;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.48;
}

.search-form {
  display: grid;
  gap: 16px;
}

label {
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 800;
}

.location-row {
  display: grid;
  grid-template-columns: 1fr 118px;
  gap: 8px;
}

input,
select {
  width: 100%;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #111612;
  color: var(--ink);
  padding: 0 12px;
}

input:focus,
select:focus,
button:focus-visible {
  outline: 3px solid rgba(143, 199, 163, 0.28);
  outline-offset: 2px;
}

.controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
}

.primary-button,
.icon-button,
.tab {
  border: 0;
  cursor: pointer;
}

.primary-button {
  height: 48px;
  border-radius: 6px;
  background: #6aa782;
  color: #07110b;
  font-weight: 850;
}

.primary-button:hover {
  background: var(--accent);
}

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

.icon-button {
  display: grid;
  place-items: center;
  width: 118px;
  height: 46px;
  border-radius: 6px;
  background: var(--orange-soft);
  color: var(--warm);
  font-size: 0.86rem;
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
}

.status {
  min-height: 48px;
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.summary-bar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(22, 27, 24, 0.78);
}

.summary-bar strong {
  display: block;
  max-width: 52vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.decision-summary {
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(20, 25, 22, 0.58);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.summary-card {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 120px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 14px;
}

.summary-card h3 {
  margin: 0;
  color: var(--accent-strong);
}

.summary-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

.summary-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.summary-tag {
  display: grid;
  gap: 2px;
  min-width: 92px;
  border-radius: 6px;
  background: #111612;
  color: var(--muted);
  padding: 8px;
  font-size: 0.78rem;
  line-height: 1.25;
}

.summary-tag strong {
  color: var(--ink);
  font-size: 0.86rem;
}

.recommendation-card {
  grid-column: span 2;
  background: var(--green-soft);
}

.recommendation-card p,
.muted-text {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.tabs {
  display: flex;
  gap: 2px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  background: rgba(18, 23, 20, 0.82);
}

.tab {
  min-height: 38px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 0 14px;
  font-weight: 800;
}

.tab.active {
  background: var(--panel-soft);
  color: var(--accent-strong);
  box-shadow: 0 1px 10px rgba(0, 0, 0, 0.18);
}

.result-view {
  display: none;
  padding: 24px;
}

.result-view.active {
  display: block;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.section-note {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.result-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin: -4px 0 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(20, 25, 22, 0.78);
  padding: 14px;
}

.result-filters select:disabled {
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.72;
}

.count {
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--accent-strong);
  padding: 6px 10px;
  font-size: 0.82rem;
  font-weight: 850;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.empty-state {
  display: block;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(20, 25, 22, 0.62);
  padding: 24px;
  color: var(--muted);
}

.group {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  overflow: hidden;
}

.group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 14px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--blue-soft);
}

.group:nth-child(3n + 2) .group-header {
  background: var(--orange-soft);
}

.group:nth-child(3n + 3) .group-header {
  background: var(--green-soft);
}

.items {
  display: grid;
  gap: 0;
}

.grouped-place-list,
.place-list {
  display: grid;
  gap: 12px;
}

.place-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(21, 27, 23, 0.78);
  overflow: hidden;
}

.place-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  background: var(--blue-soft);
  padding: 12px 14px;
}

.place-group:nth-child(3n + 2) .place-group-header {
  background: var(--orange-soft);
}

.place-group:nth-child(3n + 3) .place-group-header {
  background: var(--green-soft);
}

.place-group-header h3 {
  margin: 0;
}

.place-group .place-list {
  padding: 12px;
}

.result-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #181f1b;
  padding: 16px;
}

.result-title {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.result-title strong {
  font-size: 1.05rem;
  line-height: 1.25;
}

.distance {
  flex: 0 0 auto;
  color: var(--blue);
  font-size: 0.85rem;
  font-weight: 850;
}

.place-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.place-facts div {
  border-radius: 6px;
  background: #111612;
  padding: 10px;
}

.place-facts dt {
  margin-bottom: 3px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.place-facts dd {
  margin: 0;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.25;
}

.place-summary {
  margin: 0;
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.45;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.pill {
  border-radius: 999px;
  background: #26362b;
  color: #c6d5c8;
  padding: 5px 8px;
  font-size: 0.76rem;
  font-weight: 750;
}

.card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.map-link {
  justify-self: start;
  color: var(--accent-strong);
  font-size: 0.86rem;
  font-weight: 850;
  text-decoration: none;
}

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

@media (max-width: 900px) {
  body {
    background-attachment: scroll;
  }

  .shell {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .search-panel,
  .results-panel {
    min-height: auto;
  }

  .search-panel {
    padding: 22px;
  }

  h1 {
    max-width: 12ch;
    font-size: 3rem;
  }

  .summary-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .summary-bar strong {
    max-width: calc(100vw - 76px);
  }

  .recommendation-card {
    grid-column: auto;
  }
}

@media (max-width: 560px) {
  .controls,
  .location-row {
    grid-template-columns: 1fr;
  }

  .icon-button {
    width: 100%;
  }

  .tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .result-view {
    padding: 18px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .place-facts {
    grid-template-columns: 1fr;
  }
}
