:root {
  --ink: #16231f;
  --muted: #68766f;
  --paper: #f5f2e8;
  --surface: #fffdf8;
  --green: #18392f;
  --green-soft: #dce8df;
  --amber: #d99020;
  --amber-soft: #f6e4c2;
  --blue: #69add3;
  --blue-soft: #dceef7;
  --red: #bd4b3e;
  --line: #dedbd0;
  --shadow: 0 18px 50px rgba(27, 44, 37, 0.1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  padding: 10px clamp(18px, 5vw, 72px);
  color: #fff;
  background: rgba(24, 57, 47, 0.96);
  backdrop-filter: blur(12px);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 750; text-decoration: none; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: var(--green);
  background: var(--amber);
}
.site-header nav { display: flex; gap: 24px; }
.site-header nav a { text-decoration: none; font-weight: 650; }

main { overflow: hidden; }
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 520px);
  gap: clamp(28px, 6vw, 90px);
  align-items: center;
  max-width: 1240px;
  min-height: 620px;
  margin: auto;
  padding: 64px clamp(20px, 5vw, 72px) 80px;
}
.hero h1 {
  max-width: 720px;
  margin: 8px 0 18px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(44px, 6.5vw, 86px);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.045em;
}
.hero-text { max-width: 620px; margin: 0 0 30px; color: var(--muted); font-size: clamp(18px, 2vw, 22px); }
.eyebrow { margin: 0; color: var(--red); font-size: 13px; font-weight: 800; letter-spacing: 0.15em; text-transform: uppercase; }
.hero-photo { position: relative; margin: 0; }
.hero-photo::before {
  content: "";
  position: absolute;
  inset: 20px -22px -20px 22px;
  border-radius: 28px;
  background: var(--amber);
  transform: rotate(3deg);
}
.hero-photo img { position: relative; display: block; width: 100%; border-radius: 28px; box-shadow: var(--shadow); }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 11px 20px;
  border: 0;
  border-radius: 999px;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}
.button-primary { color: #fff; background: var(--green); }
.button:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 3px solid rgba(217, 144, 32, 0.65);
  outline-offset: 3px;
}

.places-section, .chat-section { padding: 80px clamp(20px, 5vw, 72px); }
.places-section { color: #fff; background: var(--green); }
.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  max-width: 1380px;
  margin: 0 auto 24px;
}
.section-heading h2, .chat-intro h2 { margin: 5px 0 0; font-family: Georgia, serif; font-size: clamp(38px, 5vw, 64px); font-weight: 500; }
.status-summary { padding-bottom: 8px; color: #d7e3df; }
.status-summary strong { color: #fff; font-size: 24px; }

.filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(2, minmax(150px, 230px));
  gap: 12px;
  max-width: 1380px;
  margin: 0 auto 18px;
}
.filters label { display: grid; gap: 6px; color: #d7e3df; font-size: 13px; font-weight: 700; }
.filters input, .filters select {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 12px;
  color: #fff;
  background: rgba(255,255,255,.1);
}
.filters input::placeholder { color: rgba(255,255,255,.68); }
.filters select option { color: var(--ink); }

.places-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, .75fr);
  gap: 18px;
  max-width: 1380px;
  margin: auto;
}
.map-shell { position: relative; min-height: 610px; overflow: hidden; border-radius: 22px; background: #e7e4da; }
#map { position: absolute; inset: 0; }
.map-marker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  filter: drop-shadow(0 2px 5px rgba(0,0,0,.24));
}
.map-marker-dot {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--amber);
}
.map-marker.is-visited .map-marker-dot { background: #3c8c64; }
.map-marker.is-planned .map-marker-dot { background: var(--blue); }
.map-marker-label {
  display: none;
  max-width: 170px;
  overflow: hidden;
  padding: 5px 8px;
  border: 1px solid rgba(22,35,31,.14);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255,253,248,.96);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.map-marker.show-label .map-marker-label { display: block; }
.map-marker.is-selected .map-marker-label { color: #fff; background: var(--green); }
.map-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 8px;
  padding: 32px;
  color: var(--ink);
  text-align: center;
  background:
    linear-gradient(120deg, transparent 48%, rgba(24,57,47,.08) 49%, rgba(24,57,47,.08) 51%, transparent 52%),
    #e7e4da;
  background-size: 56px 56px;
}
.map-fallback[hidden] { display: none; }
.map-legend {
  position: absolute;
  left: 14px;
  bottom: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255,253,248,.94);
  box-shadow: 0 5px 18px rgba(0,0,0,.12);
  font-size: 12px;
}
.map-legend span { white-space: nowrap; }
.dot { display: inline-block; width: 10px; height: 10px; margin-right: 4px; border-radius: 50%; }
.dot-unvisited { background: var(--amber); }
.dot-planned { background: var(--blue); }
.dot-visited { background: #3c8c64; }

.places-panel { min-height: 610px; padding: 16px; border-radius: 22px; color: var(--ink); background: var(--surface); }
.list-summary { margin: 2px 4px 14px; color: var(--muted); font-size: 14px; }
.places-list { display: grid; gap: 10px; max-height: 550px; overflow-y: auto; padding-right: 4px; }
.place-card { border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.place-card.is-selected { border-color: var(--amber); box-shadow: 0 0 0 2px var(--amber-soft); }
.place-card.is-planned.is-selected { border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue-soft); }
.place-select {
  display: grid;
  grid-template-columns: 12px 1fr;
  gap: 11px;
  width: 100%;
  padding: 14px;
  border: 0;
  color: inherit;
  text-align: left;
  background: transparent;
  cursor: pointer;
}
.place-status { width: 11px; height: 11px; margin-top: 5px; border-radius: 50%; background: var(--amber); }
.place-card.is-visited .place-status { background: #3c8c64; }
.place-card.is-planned .place-status { background: var(--blue); }
.place-copy { display: grid; gap: 2px; }
.place-address { color: var(--muted); font-size: 13px; }
.place-actions { display: flex; align-items: center; gap: 8px; padding: 0 14px 14px 37px; }
.place-actions button, .place-actions a {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--green);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.visit-details { display: grid; gap: 2px; min-width: 0; margin-right: auto; }
.visit-date { color: var(--muted); font-size: 12px; }
.place-comment { overflow-wrap: anywhere; color: var(--ink); font-size: 12px; line-height: 1.35; }

.chat-section {
  display: grid;
  grid-template-columns: minmax(250px, .75fr) minmax(360px, 1.25fr);
  gap: clamp(30px, 7vw, 100px);
  max-width: 1240px;
  margin: auto;
}
.chat-intro > p:not(.eyebrow) { color: var(--muted); }
.quick-questions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.quick-questions button {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--green);
  background: var(--surface);
  cursor: pointer;
}
.chat-card { overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); }
.chat-history { display: flex; flex-direction: column; gap: 12px; min-height: 390px; max-height: 520px; overflow-y: auto; padding: 22px; }
.message { max-width: 84%; padding: 11px 14px; border-radius: 16px; white-space: pre-line; }
.message-user { align-self: end; color: #fff; background: var(--green); border-bottom-right-radius: 4px; }
.message-assistant { align-self: start; background: var(--green-soft); border-bottom-left-radius: 4px; }
.message-error { color: #7b2117; background: #f5d8d4; }
.chat-form { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 14px; border-top: 1px solid var(--line); }
.chat-form textarea { resize: none; padding: 11px 13px; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); background: #fff; }

footer { display: flex; justify-content: space-between; gap: 20px; padding: 22px clamp(20px, 5vw, 72px); color: #d7e3df; background: #102a22; font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; min-height: auto; }
  .hero-photo { max-width: 620px; }
  .places-layout, .chat-section { grid-template-columns: 1fr; }
  .map-shell { min-height: 500px; }
  .places-panel { min-height: 0; }
  .places-list { max-height: 520px; }
}
@media (max-width: 650px) {
  .site-header nav { display: none; }
  .hero, .places-section, .chat-section { padding-left: 16px; padding-right: 16px; }
  .hero { padding-top: 42px; }
  .hero h1 { font-size: 47px; }
  .hero-photo::before { inset: 12px -8px -12px 8px; }
  .filters { grid-template-columns: 1fr; }
  .section-heading { align-items: start; flex-direction: column; }
  .map-shell { min-height: 430px; }
  .map-legend { right: 10px; left: 10px; justify-content: center; }
  .place-actions { flex-wrap: wrap; }
  .chat-form { grid-template-columns: 1fr; }
  .chat-form .button { width: 100%; }
  footer { flex-direction: column; }
}
