
/* Layout: split screen, filter rail + results list on the left, live map on the right; stacks map-over-list on phones. */
:root {
  --bg: #f6f4ee;
  --panel: #fffdf8;
  --ink: #23271f;
  --muted: #6b6a5c;
  --line: #e2ddcf;
  --olive: #857552;      /* Israel Trails brand tan */
  --forest: #0B2719;     /* heading green */
  --chip: #efeadc;
  --chip-on: #1f3b2d;
  --chip-on-ink: #fdfbf4;
  --land: #ebe5d3;
  --sea: #cfdde0;
  --lake: #b9d0d6;
  --easy: #3f8a4f;
  --moderate: #c99a2e;
  --hard: #c4622d;
  --insane: #8c2f39;
  --focus: #2f6f8f;
  --display: "Oswald", "Arial Narrow", Arial, sans-serif;
  --body: "Assistant", "Segoe UI", system-ui, sans-serif;
}
body.bare { background: var(--bg); }
.app, .app button, .app input, .app select { font-size: 15px; line-height: 1.45; }
* { box-sizing: border-box; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.app { display: grid; grid-template-columns: minmax(340px, 440px) 1fr; grid-template-rows: 100%; height: calc(100vh - 61px); height: calc(100dvh - 61px); }
.side { display: flex; flex-direction: column; min-height: 0; overflow-y: auto; border-right: 1px solid var(--line); background: var(--panel); }
.head { padding-block: 18px 12px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: 16px; border-bottom: 1px solid var(--line); display: grid; gap: 12px; }
.brand { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.sub { display: block; font-family: var(--body); font-size: 13px; letter-spacing: .1em; color: var(--muted); font-weight: 600; margin-top: 2px; }
h1 { font-family: var(--display); font-weight: 500; font-size: 26px; letter-spacing: .02em; margin: 0; color: var(--forest); text-transform: uppercase; text-wrap: balance; }
h1 span { color: var(--olive); }
.count { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

.search { display: flex; gap: 8px; }
.search input { flex: 1; min-width: 0; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.near { display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; align-items: center; font-size: 14px; }
.near select { padding: 7px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); min-width: 0; }
.near .range { display: flex; align-items: center; gap: 8px; min-width: 0; }
.near input[type=range] { flex: 1; min-width: 0; accent-color: var(--forest); }
.near output { font-variant-numeric: tabular-nums; min-width: 74px; text-align: right; color: var(--muted); font-size: 13px; }
.lbl { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }

.toggle-filters { justify-self: start; background: none; border: 0; padding: 0; color: var(--forest); font-weight: 600; cursor: pointer; font-size: 14px; }
.filters { display: grid; gap: 10px; }
.filters .frow.more, .filters .sliders.more { display: none; }
.filters[data-more="true"] .frow.more, .filters[data-more="true"] .sliders.more { display: grid; }
.frow { display: grid; gap: 5px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid transparent; background: var(--chip); padding: 4px 10px; border-radius: 999px; font-size: 13px; cursor: pointer; line-height: 1.3; }
.chip:hover { border-color: var(--olive); }
.chip[aria-pressed="true"] { background: var(--chip-on); color: var(--chip-on-ink); }
.chip .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; vertical-align: 0; }
.sliders { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sliders label { display: grid; gap: 3px; font-size: 13px; color: var(--muted); }
.sliders input { accent-color: var(--forest); width: 100%; }
.tools { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; }
.tools select { padding: 5px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); }
.linkbtn { background: none; border: 0; color: var(--olive); cursor: pointer; padding: 0; text-decoration: underline; font-size: 13px; }

.list { flex: 1; padding-block: 8px 24px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: 16px; display: grid; gap: 8px; align-content: start; }
.card { display: grid; gap: 6px; padding: 12px 12px 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); cursor: pointer; text-align: left; width: 100%; position: relative; }
.card:hover, .card.active { border-color: var(--olive); }
.card.active { box-shadow: 0 0 0 1px var(--olive); }
.card .top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.card h3 { margin: 0; font-family: var(--display); font-weight: 500; font-size: 18px; letter-spacing: .01em; color: var(--forest); min-width: 0; }
.card .he { font-size: 14px; color: var(--muted); direction: rtl; white-space: nowrap; }
.card p { margin: 0; color: var(--muted); font-size: 14px; }
.stats { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; font-variant-numeric: tabular-nums; }
.stats b { font-weight: 600; }
.diff { font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.badges { display: flex; flex-wrap: wrap; gap: 5px; }
.badge { font-size: 12px; padding: 1px 7px; border-radius: 4px; background: var(--chip); color: var(--ink); }
.badge.no { text-decoration: line-through; color: var(--muted); }
.drive { font-size: 12px; color: var(--olive); font-weight: 600; }
.empty { color: var(--muted); padding: 24px 4px; text-align: center; }

.detail { display: grid; gap: 10px; border-top: 1px dashed var(--line); padding-top: 10px; margin-top: 4px; cursor: default; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px 12px; }
.fact { display: grid; gap: 1px; }
.fact .v { font-weight: 600; font-variant-numeric: tabular-nums; }
.fact .v.est::after { content: " est."; font-weight: 400; color: var(--muted); font-size: 11px; }
.nav { display: flex; flex-wrap: wrap; gap: 8px; }
.nav a { font-size: 13px; padding: 6px 10px; border-radius: 6px; background: var(--forest); color: var(--chip-on-ink); text-decoration: none; font-weight: 600; }
.nav a.alt { background: var(--chip); color: var(--ink); }
.note { font-size: 12px; color: var(--muted); }

.mapwrap { position: relative; min-height: 0; }
#map { position: absolute; inset: 0; background: var(--sea); }
.leaflet-container { font-family: var(--body); background: var(--sea); }
.legend { position: absolute; right: max(12px, env(safe-area-inset-right, 0px)); bottom: 22px; z-index: 500; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 12px; display: grid; gap: 3px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; border: 2px solid var(--panel); box-shadow: 0 0 0 1px var(--ink); }
.pin { width: 16px; height: 16px; border-radius: 50%; border: 2.5px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.45); }
.pin.on { width: 22px; height: 22px; margin: -3px 0 0 -3px; box-shadow: 0 0 0 3px var(--ink), 0 2px 6px rgba(0,0,0,.4); }
.city-lbl { font-family: var(--display); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.city-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.leaflet-tooltip { font-family: var(--body); }

@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; grid-template-rows: 42vh auto; height: auto; min-height: 100%; }
  .mapwrap { grid-row: 1; height: 42vh; }
  .side { grid-row: 2; border-right: 0; }
  .list { overflow: visible; }
  .filters[data-collapsed="true"] { display: none; }
}
@media (min-width: 761px) { .toggle-filters { display: none; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

.card .open { font-size: 13px; font-weight: 600; color: var(--olive); }
.badge.walked { background: var(--forest); color: var(--chip-on-ink); }
.app h1 { font-size: 22px; }

.guide-cta { margin: 0; font-size: 13px; color: var(--muted); background: var(--chip); border-radius: 8px; padding: 7px 10px; }
.guide-cta a { color: var(--forest); font-weight: 600; }
