:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --panel: #ffffff;
  --ink: #17211d;
  --muted: #5f6f68;
  --line: #dce2dc;
  --teal: #0f766e;
  --teal-dark: #115e59;
  --sky: #2563eb;
  --leaf: #3f7d20;
  --coral: #d24b36;
  --amber: #b7791f;
  --soft-teal: #e6f4f1;
  --soft-sky: #e8f0ff;
  --soft-leaf: #ecf6e8;
  --soft-coral: #fff0ed;
  --shadow: 0 18px 45px rgba(25, 39, 31, 0.12);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.09), transparent 34%),
    linear-gradient(225deg, rgba(210, 75, 54, 0.08), transparent 28%),
    var(--bg);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 18px;
}

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

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

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 8px;
  font-size: 1.4rem;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 6px;
  font-size: 1.05rem;
  letter-spacing: 0;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(15, 118, 110, 0.3);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--teal-dark);
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 10px 30px rgba(15, 118, 110, 0.08);
}

.live-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--leaf);
  box-shadow: 0 0 0 5px rgba(63, 125, 32, 0.14);
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(320px, 440px) minmax(0, 1fr);
  gap: 22px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 36px;
  align-items: start;
}

.finder-panel,
.results-panel {
  border: 1px solid rgba(220, 226, 220, 0.92);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.finder-panel {
  position: sticky;
  top: 16px;
  padding: 22px;
}

.results-panel {
  min-height: 620px;
  padding: 22px;
}

.section-heading p,
.result-heading p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

.finder-form {
  display: grid;
  gap: 18px;
  margin-top: 22px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.field {
  display: grid;
  gap: 8px;
  margin: 0;
  min-width: 0;
  border: 0;
  padding: 0;
}

.field span,
.field legend {
  color: #26352f;
  font-weight: 800;
}

.field small {
  color: var(--muted);
  line-height: 1.35;
}

input[type="text"],
select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

input[type="text"]:focus,
select:focus,
input[type="range"]:focus-visible,
button:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.22);
  outline-offset: 2px;
}

.activity-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.activity-option {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
  min-height: 78px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.activity-option input {
  margin-top: 3px;
  accent-color: var(--teal);
}

.activity-label {
  color: var(--ink);
  font-weight: 850;
}

.activity-examples {
  grid-column: 2;
  display: block;
  min-width: 0;
}

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

.segmented label {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  color: #2d3934;
  padding: 6px 2px;
  font-size: 0.68rem;
  font-weight: 750;
  line-height: 1.1;
  text-align: center;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

.segmented input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.segmented label:has(input:checked) {
  border-color: rgba(15, 118, 110, 0.5);
  background: var(--soft-teal);
  color: var(--teal-dark);
}

.range-field input {
  width: 100%;
  accent-color: var(--teal);
}

.button-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
}

.primary-button,
.secondary-button,
.ghost-button,
.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 8px 12px;
  font-weight: 850;
  line-height: 1.15;
  text-align: center;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.button-row button {
  width: 100%;
  min-width: 0;
  min-height: 54px;
  font-size: 0.96rem;
  white-space: normal;
}

.primary-button {
  background: var(--teal);
  color: #fff;
}

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

.secondary-button {
  border-color: rgba(37, 99, 235, 0.28);
  background: var(--soft-sky);
  color: #174ea6;
}

.ghost-button {
  border-color: var(--line);
  background: #fff;
  color: #37433e;
}

.loading-state,
.empty-state {
  display: grid;
  place-items: center;
  gap: 18px;
  min-height: 430px;
  color: var(--muted);
  text-align: center;
}

.spinner {
  width: 46px;
  height: 46px;
  border: 4px solid #dce8e4;
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.map-visual {
  position: relative;
  width: min(360px, 90%);
  aspect-ratio: 1.65;
  border: 1px solid #d6e0d8;
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(15, 118, 110, 0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(37, 99, 235, 0.08) 1px, transparent 1px),
    linear-gradient(145deg, #f0f7ef, #f8fbff);
  background-size: 38px 38px, 38px 38px, auto;
}

.pin {
  position: absolute;
  width: 20px;
  height: 20px;
  border: 4px solid #fff;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  box-shadow: 0 8px 20px rgba(23, 33, 29, 0.2);
}

.pin-one {
  left: 20%;
  top: 26%;
  background: var(--coral);
}

.pin-two {
  left: 58%;
  top: 36%;
  background: var(--sky);
}

.pin-three {
  left: 74%;
  top: 66%;
  background: var(--leaf);
}

.route {
  position: absolute;
  height: 4px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.35);
  transform-origin: left center;
}

.route-one {
  left: 25%;
  top: 39%;
  width: 35%;
  transform: rotate(10deg);
}

.route-two {
  left: 61%;
  top: 48%;
  width: 24%;
  transform: rotate(43deg);
  background: rgba(37, 99, 235, 0.3);
}

.summary-chips,
.tag-row,
.place-actions,
.event-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.summary-chips {
  margin: 20px 0 12px;
}

.chip,
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 0 10px;
  background: #edf3ef;
  color: #31413b;
  font-size: 0.86rem;
  font-weight: 800;
}

.message-box {
  margin: 14px 0 0;
  border: 1px solid rgba(15, 118, 110, 0.22);
  border-radius: 8px;
  padding: 14px;
  background: var(--soft-teal);
  color: #24413b;
  line-height: 1.5;
}

.message-box.error {
  border-color: rgba(210, 75, 54, 0.36);
  background: var(--soft-coral);
  color: #7a261a;
}

.message-box.warning {
  border-color: rgba(183, 121, 31, 0.34);
  background: #fff8e8;
  color: #60430d;
}

.result-section {
  margin-top: 28px;
}

.result-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.map-view {
  width: 100%;
  height: 480px;
  min-height: 480px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #eef4f1;
}

.map-view.leaflet-container {
  height: 480px;
  min-height: 480px;
}

.leaflet-container {
  position: relative;
  overflow: hidden;
  outline: 0;
}

.leaflet-pane,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-tile-container,
.leaflet-pane > svg,
.leaflet-pane > canvas,
.leaflet-zoom-box,
.leaflet-image-layer,
.leaflet-layer {
  position: absolute;
  left: 0;
  top: 0;
}

.leaflet-container img.leaflet-tile,
.leaflet-container .leaflet-marker-icon,
.leaflet-container .leaflet-marker-shadow {
  max-width: none !important;
  max-height: none !important;
}

.leaflet-tile {
  width: 256px;
  height: 256px;
  user-select: none;
}

.leaflet-control-container .leaflet-top,
.leaflet-control-container .leaflet-bottom {
  position: absolute;
  z-index: 1000;
  pointer-events: none;
}

.leaflet-top {
  top: 0;
}

.leaflet-bottom {
  bottom: 0;
}

.leaflet-left {
  left: 0;
}

.leaflet-right {
  right: 0;
}

.leaflet-control {
  position: relative;
  z-index: 1000;
  pointer-events: auto;
}

.leaflet-top .leaflet-control {
  margin-top: 10px;
}

.leaflet-left .leaflet-control {
  margin-left: 10px;
}

.leaflet-control-zoom {
  border: 1px solid rgba(23, 33, 29, 0.18);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 8px 18px rgba(23, 33, 29, 0.18);
}

.leaflet-control-zoom a {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--ink);
  background: #fff;
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
}

.leaflet-control-zoom a + a {
  border-top: 1px solid var(--line);
}

.leaflet-control-zoom a:hover {
  background: var(--soft-teal);
  color: var(--teal-dark);
}

.leaflet-popup {
  position: absolute;
  text-align: center;
  margin-bottom: 20px;
}

.map-pin {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 950;
  box-shadow: 0 8px 18px rgba(23, 33, 29, 0.24);
}

.map-pin.source {
  background: var(--sky);
}

.map-popup {
  min-width: 190px;
}

.map-popup h4 {
  margin: 0 0 5px;
  font-size: 0.98rem;
}

.map-popup p {
  margin: 0 0 8px;
  color: var(--muted);
  line-height: 1.35;
}

.map-popup a {
  color: var(--sky);
  font-weight: 850;
  text-decoration: none;
}

.map-card-button {
  min-height: 32px;
  margin-top: 8px;
  border: 1px solid rgba(37, 99, 235, 0.24);
  border-radius: 8px;
  padding: 0 10px;
  background: var(--soft-sky);
  color: #174ea6;
  font: inherit;
  font-weight: 850;
}

.place-card.is-highlighted {
  border-color: rgba(37, 99, 235, 0.7);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14), var(--shadow);
}

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

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

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

.place-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 54px;
  padding: 0 15px;
  background: #fbfcfb;
  color: #21322b;
  cursor: pointer;
  font-weight: 900;
}

.place-group summary::-webkit-details-marker {
  display: none;
}

.place-group summary::before {
  content: "+";
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--soft-teal);
  color: var(--teal-dark);
  font-weight: 950;
}

.place-group[open] summary::before {
  content: "-";
}

.place-group summary span {
  flex: 1 1 auto;
}

.place-group summary strong {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.9rem;
}

.place-group-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 12px;
  border-top: 1px solid var(--line);
}

.plan-card,
.place-card,
.event-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.plan-card,
.place-card {
  padding: 15px;
}

.plan-card {
  border-top: 5px solid var(--teal);
}

.plan-card:nth-child(2) {
  border-top-color: var(--sky);
}

.plan-card:nth-child(3) {
  border-top-color: var(--coral);
}

.plan-card:nth-child(4) {
  border-top-color: var(--leaf);
}

.plan-card p,
.place-card p,
.event-card p {
  color: var(--muted);
  line-height: 1.5;
}

.plan-stops {
  display: grid;
  gap: 9px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.plan-stops li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  color: #2d3934;
  line-height: 1.4;
}

.stop-number {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #eef4f1;
  color: var(--teal-dark);
  font-size: 0.82rem;
  font-weight: 900;
}

.place-card {
  display: grid;
  gap: 12px;
}

.idea-card {
  border-color: rgba(37, 99, 235, 0.22);
  background: #fbfdff;
}

.idea-card .score-badge {
  background: var(--soft-sky);
  color: #174ea6;
}

.place-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.place-title {
  margin-bottom: 4px;
}

.place-meta {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 750;
}

.score-badge {
  flex: 0 0 auto;
  border-radius: 8px;
  padding: 6px 8px;
  background: var(--soft-leaf);
  color: #315f19;
  font-size: 0.82rem;
  font-weight: 900;
}

.tag {
  min-height: 26px;
  background: #f1f4f7;
  font-size: 0.78rem;
}

.link-button {
  flex: 1 1 96px;
  max-width: 100%;
  min-height: 38px;
  font-size: 0.84rem;
  border-color: var(--line);
  background: #fbfcfb;
  color: #20302a;
}

.link-button:hover {
  border-color: rgba(15, 118, 110, 0.42);
  color: var(--teal-dark);
}

.event-card {
  flex: 1 1 230px;
  padding: 14px;
}

.event-card a {
  color: var(--sky);
  font-weight: 850;
  text-decoration: none;
}

.event-card a:hover {
  text-decoration: underline;
}

.empty-note {
  border: 1px dashed #c9d4cd;
  border-radius: 8px;
  padding: 16px;
  color: var(--muted);
  background: #fbfcfb;
  line-height: 1.5;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .finder-panel {
    position: static;
  }
}

@media (max-width: 680px) {
  .topbar {
    align-items: start;
    flex-direction: column;
  }

  .app-shell,
  .topbar {
    width: min(100% - 20px, 1180px);
  }

  .finder-panel,
  .results-panel {
    padding: 16px;
  }

  .form-grid,
  .activity-options,
  .plan-grid,
  .place-grid,
  .place-group-grid {
    grid-template-columns: 1fr;
  }

  .button-row {
    grid-template-columns: 1fr;
  }

  .result-heading {
    display: block;
  }

  h1 {
    font-size: 2.35rem;
  }

  .map-view,
  .map-view.leaflet-container {
    height: 380px;
    min-height: 380px;
  }
}
