:root {
  --evergreen: #1F5C4D;
  --fern: #2E8B6B;
  --ember: #E07A3C;
  --violet: #6B4FA0;
  --sand: #F4F1E8;
  --ink: #16221C;
  --muted: #6B7670;
  --line: #E7E4DA;
  --card: #ffffff;
  --bg: #FFFFFF;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: var(--bg);
}

/* ---------- Topbar ---------- */
.topbar {
  height: 62px; display: flex; align-items: center; gap: 18px;
  padding: 0 40px; background: var(--card); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 1000;
}
.brand { display: flex; align-items: center; gap: 6px; text-decoration: none; flex-shrink: 0; }
.logo, .logo-img { display: block; height: 24px; width: auto; }
.wordmark { font-size: 21px; font-weight: 800; letter-spacing: -0.01em; color: var(--ink); margin-top: -3px; }
.mark-accent { color: var(--evergreen); }
.search {
  position: relative; flex: 0 1 360px; display: flex; align-items: center; gap: 9px;
  background: #F1F0EC; border-radius: 999px; height: 40px; padding: 0 16px;
}
.search-ic { width: 18px; height: 18px; color: var(--muted); flex-shrink: 0; }
.search input { flex: 1; min-width: 0; border: none; background: transparent; outline: none; font-family: inherit; font-size: 14.5px; color: var(--ink); }
.search-results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 1300;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 12px 32px rgba(20,40,30,.18); padding: 8px; max-height: 70vh; overflow-y: auto;
}
.search-results[hidden] { display: none; }
.sr-item {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: none; border: none; cursor: pointer; padding: 8px 10px; border-radius: 10px; font-family: inherit;
}
.sr-item:hover { background: var(--sand); }
.sr-thumb { width: 52px; height: 40px; border-radius: 8px; background: var(--sand) center/cover no-repeat; flex-shrink: 0; }
.sr-text { display: flex; flex-direction: column; min-width: 0; }
.sr-title { font-size: 14.5px; font-weight: 700; color: var(--ink); }
.sr-loc { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: var(--fern); }
.sr-empty { padding: 14px 12px; font-size: 14px; color: var(--muted); }
.topnav { margin-left: auto; display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.nav-link { background: none; border: none; font-family: inherit; font-size: 15px; font-weight: 700; color: var(--ink); cursor: pointer; padding: 6px 4px; }
.nav-link:hover { color: var(--evergreen); }
.nav-icon { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--ink); }
.nav-icon:hover { background: var(--sand); }
.nav-icon svg { width: 19px; height: 19px; }
.nav-avatar { width: 36px; height: 36px; border-radius: 50%; border: none; background: var(--evergreen); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.nav-avatar svg { width: 20px; height: 20px; }

/* ---------- Explore (single column, centered) ---------- */
.explore { max-width: 920px; margin: 0 auto; padding: 8px 24px 70px; }
.list-head { padding: 24px 0 4px; }
.list-head h1 { font-size: 26px; font-weight: 800; margin: 0; letter-spacing: -0.01em; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; padding: 14px 2px 4px; }
.filter-group { position: relative; }
.filter-btn {
  display: inline-flex; align-items: center; gap: 6px; font-family: inherit;
  font-size: 13px; font-weight: 600; color: var(--ink);
  background: var(--card); border: 1px solid var(--line); border-radius: 9px;
  padding: 8px 12px; cursor: pointer; transition: border-color .12s;
}
.filter-btn:hover { border-color: #C9C6BB; }
.filter-btn.active { border-color: var(--evergreen); color: var(--evergreen); }
.filter-btn .caret { font-size: 9px; color: var(--muted); }
.filter-pop {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 1200;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 10px 28px rgba(20,40,30,.16); padding: 8px; min-width: 184px;
}
.filter-pop-wide { min-width: 264px; padding: 16px; }
.pop-opt { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; font-size: 14px; cursor: pointer; }
.pop-opt:hover { background: var(--sand); }
.pop-opt input { accent-color: var(--evergreen); width: 16px; height: 16px; margin: 0; }
.pop-title { font-size: 13px; font-weight: 700; color: var(--ink); margin-bottom: 14px; }
.pop-scale { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 6px; }
.pop-scale #drive-val { font-weight: 700; color: var(--ink); }
.pop-apply { margin-top: 14px; width: 100%; font-family: inherit; font-weight: 700; font-size: 13px; color: #fff; background: var(--evergreen); border: none; border-radius: 8px; padding: 9px; cursor: pointer; }
.pop-apply:hover { background: #16463A; }
#drive-range { width: 100%; accent-color: var(--evergreen); }
.feed-foot { color: var(--muted); font-size: 12px; line-height: 1.5; margin: 22px 2px 0; }

/* ---------- Tiles ---------- */
.feed { display: flex; flex-direction: column; gap: 16px; padding-top: 14px; }
.tile {
  display: flex; gap: 18px; background: var(--card); border: 1px solid var(--line);
  border-radius: 18px; padding: 14px; cursor: pointer; transition: background .12s;
  height: 240px; overflow: hidden;
}
.tile:hover { background: #F4F4F2; }
.tile-photo {
  width: 340px; align-self: stretch; min-height: 200px; flex-shrink: 0; border-radius: 14px;
  overflow: hidden; position: relative; background: var(--sand);
}
.tile-img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; display: block; transition: transform .4s ease; }
.tile:hover .tile-img { transform: scale(1.08); }
.t-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(255,255,255,.3); color: var(--ink); font-size: 18px; line-height: 1;
  display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .2s, background .2s;
}
.tile:hover .t-arrow { opacity: .85; }
.t-arrow:hover { background: rgba(255,255,255,.98); opacity: 1; }
.t-prev { left: 8px; }
.t-next { right: 8px; }
.tile-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tile-title { font-size: 21px; font-weight: 800; margin: 4px 0 3px; line-height: 1.2; letter-spacing: -0.01em; }
.tile-loc { font-size: 13px; font-weight: 700; color: var(--fern); margin: 0 0 9px; text-transform: uppercase; letter-spacing: .04em; }
.tile-desc { font-size: 14.5px; line-height: 1.5; color: #46524c; margin: 0 0 9px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile-sight { font-size: 13px; font-weight: 600; color: var(--evergreen); margin: 0 0 auto; display: flex; align-items: center; gap: 6px; }
.tile-stats { display: flex; align-items: center; gap: 26px; margin-top: 14px; }
.tile-go { margin-left: auto; align-self: flex-end; font-size: 14px; font-weight: 700; color: var(--evergreen); white-space: nowrap; }
.stat { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.stat .cap { font-size: 10px; font-weight: 700; letter-spacing: .05em; color: var(--muted); text-transform: uppercase; white-space: nowrap; }

/* ---------- Profile page ---------- */
.profile { background: var(--bg); }
.profile[hidden] { display: none; }
.p-wrap { max-width: 920px; margin: 0 auto; padding: 18px 24px 80px; }
.p-back {
  display: inline-flex; align-items: center; gap: 7px; margin: 4px 0 16px;
  background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px 8px 12px;
  font-family: inherit; font-size: 14px; font-weight: 700; color: var(--ink); cursor: pointer;
}
.p-back:hover { background: var(--sand); }
.p-title { font-size: 32px; font-weight: 800; margin: 0 0 5px; letter-spacing: -0.01em; }
.p-loc { font-size: 13px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--fern); margin: 0 0 16px; }
.p-gallery { position: relative; overflow: hidden; border-radius: 18px; }
.p-hero-img {
  width: 100%; height: 300px; object-fit: cover; object-position: center 30%;
  display: block; background: var(--sand); transition: transform .4s ease;
}
.p-gallery:hover .p-hero-img { transform: scale(1.1); }
.g-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(255,255,255,.3); color: var(--ink); font-size: 22px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  opacity: .5; transition: opacity .2s, background .2s;
}
.p-gallery:hover .g-arrow { opacity: .9; }
.g-arrow:hover { background: rgba(255,255,255,.98); opacity: 1; }
.g-prev { left: 14px; }
.g-next { right: 14px; }
.g-dots { position: absolute; bottom: 14px; left: 0; right: 0; display: flex; justify-content: center; gap: 7px; }
.g-dot { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.55); }
.g-dot.on { background: #fff; }
/* ---------- Profile upper panel: image (left) + scores (right) ---------- */
.p-top { display: flex; gap: 18px; align-items: stretch; margin-bottom: 6px; }
.p-top-media { flex: 0 0 64%; min-width: 0; }
.p-top-media .p-gallery, .p-top-media .p-hero-img { height: 100%; min-height: 360px; }
.p-top-scores { flex: 1; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.score-row { flex: 1; display: flex; align-items: center; gap: 13px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 15px; overflow: hidden; }
.score-row svg { flex-shrink: 0; }
.score-text { min-width: 0; }
.score-name { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ink); }
.score-def { font-size: 11.5px; color: var(--muted); margin: 2px 0 5px; line-height: 1.35; }
.score-why { font-size: 12.5px; color: #46524c; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.p-summary { font-size: 17px; line-height: 1.65; color: #2b3631; margin: 24px 0 28px; }

.gauges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.gauge-card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 22px 18px; text-align: center; }
.gauge-card .cap { font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ink); margin-top: 14px; }
.gauge-card .def { font-size: 12.5px; line-height: 1.5; color: var(--muted); margin: 6px 0 10px; }
.gauge-card .why { font-size: 13px; line-height: 1.55; color: #46524c; margin: 0; text-align: left; border-top: 1px solid var(--line); padding-top: 10px; }

.p-section-title { font-size: 19px; font-weight: 800; margin: 30px 0 12px; }
.p-divider { border: none; border-top: 1px solid var(--line); margin: 24px -24px; }

/* ---------- Top experiences nearby ---------- */
.nearby-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.nearby-card { cursor: pointer; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--card); transition: background .12s; }
.nearby-card:hover { background: #F4F4F2; }
.nearby-photo { height: 130px; background: var(--sand) center/cover no-repeat; }
.nearby-body { padding: 11px 13px 14px; }
.nearby-title { font-size: 15.5px; font-weight: 800; line-height: 1.22; margin-bottom: 4px; }
.nearby-loc { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--fern); margin-bottom: 7px; }
.nearby-meta { font-size: 12.5px; color: var(--muted); }
@media (max-width: 640px) { .nearby-grid { grid-template-columns: 1fr; } }

/* ---------- Plan your trip ---------- */
.plan-toggle { display: inline-flex; background: var(--sand); border-radius: 999px; padding: 4px; gap: 4px; margin-bottom: 16px; }
.plan-tab {
  border: none; background: transparent; font-family: inherit; font-size: 14px; font-weight: 700;
  color: var(--muted); padding: 8px 20px; border-radius: 999px; cursor: pointer;
}
.plan-tab.active { background: var(--evergreen); color: #fff; }
.plan-panel[hidden] { display: none; }
.plan-row { padding: 12px 0; border-bottom: 1px solid var(--line); }
.plan-row:last-child { border-bottom: none; }
.plan-label { display: block; font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--fern); margin-bottom: 4px; }
.plan-row p { margin: 0; font-size: 15px; line-height: 1.6; color: #2b3631; }
.plan-empty { margin: 0; font-size: 15px; line-height: 1.6; color: var(--muted); background: var(--sand); border-radius: 12px; padding: 16px 18px; }
.vendor {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 16px; margin-bottom: 10px; text-decoration: none; transition: box-shadow .15s, transform .15s;
}
.vendor:hover { box-shadow: 0 6px 18px rgba(20,40,30,.12); transform: translateY(-1px); }
.vendor-name { font-size: 15.5px; font-weight: 700; color: var(--ink); }
.vendor-note { font-size: 13px; color: #46524c; margin-top: 2px; line-height: 1.45; }
.vendor-link { flex-shrink: 0; font-size: 13px; font-weight: 700; color: var(--evergreen); white-space: nowrap; }
.plan-rec { margin: 0 0 8px; font-size: 15px; line-height: 1.55; font-weight: 600; color: var(--evergreen); background: #EAF3EE; border-radius: 10px; padding: 10px 12px; }
.plan-rec i { font-style: normal; margin-right: 4px; }

/* ---------- Recent sightings ---------- */
.rs-list { display: flex; flex-direction: column; gap: 10px; }
.rs-row { display: grid; grid-template-columns: 128px 1fr; gap: 12px; align-items: start; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 13px 16px; }
.rs-src { font-size: 13px; font-weight: 800; color: var(--evergreen); }
.rs-val { font-size: 14px; line-height: 1.5; color: #2b3631; }
.rs-posts { display: flex; flex-direction: column; gap: 7px; }
.rs-post { font-size: 14px; line-height: 1.4; color: #2b3631; text-decoration: none; }
.rs-post:hover { color: var(--evergreen); text-decoration: underline; }
.rs-sub { color: var(--muted); font-weight: 600; font-size: 12px; }
.rs-insight { font-size: 15.5px; line-height: 1.6; color: #2b3631; margin: 0 0 14px; }
.rs-chart { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px 8px; margin-bottom: 14px; }
.rs-chart-cap { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.rs-bullets { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; }
.rs-bullets li { font-size: 15px; line-height: 1.5; }
.rs-bullets a { color: #2b3631; text-decoration: none; }
.rs-bullets a:hover { color: var(--evergreen); text-decoration: underline; }
.rs-ext { color: var(--evergreen); font-weight: 700; }

/* ---------- Conditions ---------- */
.cond-card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 20px 22px; }
.cond-head { display: flex; justify-content: space-between; align-items: flex-start; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.cond-temp { font-size: 40px; font-weight: 800; line-height: 1; }
.cond-cond { font-size: 14px; color: var(--muted); margin-top: 4px; }
.cond-meta { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: #3a443f; text-align: right; }
.cond-rows { display: flex; flex-direction: column; }
.cond-row { display: grid; grid-template-columns: 92px 34px 1fr 34px; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid #f1efe8; }
.cond-row:last-child { border-bottom: none; }
.cond-day { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 7px; }
.cond-lo { font-size: 13px; color: var(--muted); text-align: right; }
.cond-hi { font-size: 13px; font-weight: 700; text-align: left; }
.cond-bar { position: relative; height: 6px; background: #ECEAE2; border-radius: 99px; }
.cond-fill { position: absolute; top: 0; bottom: 0; border-radius: 99px; background: linear-gradient(90deg, #74B43C, #F2B713, #E07A3C); }

.p-foot { color: var(--muted); font-size: 12px; margin-top: 26px; line-height: 1.5; }

@media (max-width: 640px) {
  /* Top bar: logo + nav on row 1, full-width search on row 2 */
  .topbar { flex-wrap: wrap; height: auto; min-height: 56px; padding: 10px 14px; gap: 10px; }
  .search { order: 3; flex: 1 1 100%; max-width: none; }
  #nav-explore, .nav-icon { display: none; } /* logo taps home; alerts page not built yet */
  .topnav { gap: 14px; }

  .tile { flex-direction: column; height: auto; }
  .tile-photo { width: 100%; height: 200px; align-self: auto; }
  .gauges { grid-template-columns: 1fr; }
  .p-top { flex-direction: column; height: auto; }
  .p-top-media { flex: none; }
  .p-top-media .p-gallery, .p-top-media .p-hero-img { height: 240px; min-height: 0; }
  .score-row { flex: none; min-height: 84px; }
}
