:root {
  color-scheme: light;
  --bg: #f4f5f1;
  --surface: #fbfcf9;
  --ink: #20231f;
  --muted: #73796f;
  --line: #dfe3db;
  --accent: #2f6851;
  --accent-dark: #25523f;
  --accent-soft: #e5eee8;
  --danger: #a4473b;
  --shadow: 0 24px 60px -36px rgba(37, 53, 43, .28);
  font-family: Geist, "Avenir Next", "Noto Sans TC", "PingFang TC", system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.topbar {
  height: 68px;
  padding: 0 clamp(18px, 3vw, 46px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(251, 252, 249, .92);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 5;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-size: 15px;
  font-weight: 720;
  letter-spacing: -.02em;
}

.brand-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--accent);
  color: white;
}

.brand-mark svg { width: 20px; }
.brand-mark path, .topbar svg path, .topbar svg circle {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.budget-pill {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  height: 36px;
  border-radius: 999px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}

.budget-pill:hover { border-color: #bec7bc; }
.budget-pill:active { transform: scale(.98); }
.budget-pill > svg { width: 16px; transition: transform .2s ease; }
.budget-pill[aria-expanded="true"] > svg { transform: rotate(180deg); }

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.budget-panel {
  position: sticky;
  top: 68px;
  z-index: 4;
  border-bottom: 1px solid var(--line);
  background: rgba(244, 245, 241, .97);
  backdrop-filter: blur(14px);
}

.budget-panel-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 18px clamp(18px, 3vw, 46px);
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 30px;
  align-items: center;
}

.budget-panel-inner > div:first-child { display: grid; gap: 3px; }
.budget-panel-inner strong { font-size: 13px; }
.budget-panel-inner span { color: var(--muted); font-size: 11px; }
.usage-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.usage-item { display: grid; gap: 6px; }
.usage-meta { display: flex; justify-content: space-between; gap: 10px; font-size: 11px; }
.usage-meta span:last-child { font-variant-numeric: tabular-nums; }
.usage-track { height: 4px; overflow: hidden; border-radius: 4px; background: #d9ddd6; }
.usage-fill { height: 100%; border-radius: inherit; background: var(--accent); transition: transform .4s cubic-bezier(.16,1,.3,1); transform-origin: left; }

.workspace {
  width: 100%;
  max-width: 1540px;
  min-height: calc(100dvh - 68px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(270px, .75fr) minmax(300px, .9fr) minmax(440px, 1.45fr);
}

.search-column,
.results-column,
.preview-column { min-width: 0; }

.search-column {
  padding: clamp(30px, 4vw, 58px) clamp(24px, 3vw, 44px);
  border-right: 1px solid var(--line);
}

.results-column {
  padding: clamp(30px, 4vw, 58px) 0;
  border-right: 1px solid var(--line);
  background: rgba(251, 252, 249, .44);
}

.preview-column {
  padding: clamp(24px, 3vw, 44px);
  display: grid;
  align-content: center;
  background: var(--surface);
}

.section-heading { margin-bottom: 34px; }
.eyebrow {
  margin: 0 0 7px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .11em;
  font-size: 10px;
  font-weight: 760;
}

h1, h2, p { margin-top: 0; }
h1 {
  margin-bottom: 0;
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.02;
  letter-spacing: -.055em;
}

h2 {
  margin-bottom: 0;
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: -.04em;
}

form { display: grid; gap: 24px; }
.field { display: grid; gap: 9px; }
.search-mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 4px;
  padding: 4px;
  margin: -10px 0 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(224, 228, 220, .55);
}
.search-mode-toggle button {
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 720;
  transition: background .2s ease, color .2s ease, transform .2s ease;
}
.search-mode-toggle button[aria-selected="true"] {
  background: var(--surface);
  color: var(--accent-dark);
  box-shadow: inset 0 0 0 1px rgba(47, 104, 81, .12);
}
.search-mode-toggle button:active { transform: scale(.98); }
.area-selects {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: 10px;
}
.area-selects.is-custom { grid-template-columns: 1fr; }
.area-selects.is-custom .city-field { grid-column: 1 / -1; }
.area-selects > .field-error { grid-column: 1 / -1; }
.field > span {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -.01em;
}
.field em { color: var(--muted); font-style: normal; font-weight: 500; margin-left: 4px; }

input[type="text"] {
  width: 100%;
  height: 48px;
  border: 1px solid #d5d9d2;
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 14px;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
input[type="text"]::placeholder { color: #a0a69d; }
input[type="text"]:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type="text"][aria-invalid="true"] { border-color: var(--danger); }
.field-error { min-height: 0; color: var(--danger); font-size: 11px; }
.field-error:empty { display: none; }

.radius-options {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
.radius-options label { position: relative; }
.radius-options input { position: absolute; opacity: 0; pointer-events: none; }
.radius-options span {
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid #d5d9d2;
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  transition: color .2s ease, border-color .2s ease, background .2s ease, transform .2s ease;
}
.radius-options span:hover { border-color: #b9c2b7; color: var(--ink); }
.radius-options input:checked + span { border-color: var(--accent); color: var(--accent-dark); background: var(--accent-soft); font-weight: 720; }
.radius-options input:focus-visible + span { outline: 3px solid var(--accent-soft); }
.radius-options span:active { transform: scale(.97); }
.search-button {
  height: 50px;
  border: 0;
  border-radius: 13px;
  background: var(--accent);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  cursor: pointer;
  font-weight: 720;
  box-shadow: 0 14px 28px -18px rgba(47, 104, 81, .7);
  transition: background .2s ease, transform .2s ease;
}
.search-button:hover { background: var(--accent-dark); }
.search-button:active { transform: translateY(1px) scale(.99); }
.search-button:disabled { cursor: wait; opacity: .72; }
.search-button svg { width: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

.traffic-anchor-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.traffic-anchor-options label { position: relative; min-width: 0; }
.traffic-anchor-options input { position: absolute; opacity: 0; pointer-events: none; }
.traffic-anchor-options label > span {
  min-height: 54px;
  padding: 8px 6px;
  display: grid;
  place-content: center;
  gap: 3px;
  border: 1px solid #d5d9d2;
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  text-align: center;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease, color .2s ease, transform .2s ease;
}
.traffic-anchor-options label > span:active { transform: scale(.97); }
.traffic-anchor-options strong { font-size: 10px; line-height: 1.15; }
.traffic-anchor-options small { overflow: hidden; color: #90978e; font-size: 8px; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; }
.traffic-anchor-options input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); }
.traffic-anchor-options input:focus-visible + span { outline: 3px solid var(--accent-soft); }
.traffic-anchor-radius {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}
.traffic-anchor-radius > span { color: var(--muted); font-size: 10px; font-weight: 700; }
.traffic-anchor-radius select {
  height: 38px;
  border-radius: 9px;
  background-position: calc(100% - 14px) 16px, calc(100% - 9px) 16px;
  padding: 0 28px 0 10px;
  font-size: 11px;
}
.traffic-anchor-radius em { margin: 0; color: var(--muted); font-size: 9px; white-space: nowrap; }

.mode-note {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.mode-note span { color: var(--accent); font-size: 11px; font-weight: 750; }
.mode-note p { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }

.population-panel {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.population-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}
.population-heading h2 { font-size: 17px; }
.population-heading > span {
  padding: 4px 7px;
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 9px;
  font-weight: 750;
}
.population-status {
  min-height: 40px;
  margin-top: 10px;
  display: flex;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
}
.population-status.is-loading::before {
  content: "";
  width: 13px;
  height: 13px;
  margin-right: 8px;
  border: 2px solid #d7ddd5;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: population-spin .7s linear infinite;
}
@keyframes population-spin { to { transform: rotate(360deg); } }
.population-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 8px;
}
.population-grid > div {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 5px;
}
.population-grid span {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 9px;
}
.population-grid strong {
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.population-grid em {
  color: var(--muted);
  font-style: normal;
  font-size: 8px;
  white-space: nowrap;
}
.population-footer {
  margin-top: 9px;
  padding: 8px 2px 0;
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
}
.population-footer strong { color: var(--ink); font-weight: 650; }

.results-header {
  padding: 0 clamp(22px, 3vw, 34px) 24px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}
.result-count {
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.results-list { display: grid; }
.result-item {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  padding: 20px clamp(22px, 3vw, 34px);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px 16px;
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px);
  animation: result-in .38s cubic-bezier(.16,1,.3,1) forwards;
  animation-delay: calc(var(--index) * 45ms);
  transition: background .2s ease, transform .2s ease;
}
.result-item:hover, .result-item[aria-current="true"] { background: var(--accent-soft); }
.result-item:active { transform: scale(.995); }
.result-name { min-width: 0; display: flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 740; letter-spacing: -.02em; }
.result-name > span { min-width: 0; }
.result-index {
  flex: 0 0 auto;
  min-width: 32px;
  height: 23px;
  padding: 0 6px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(47, 104, 81, .2);
  border-radius: 7px;
  background: rgba(47, 104, 81, .08);
  color: var(--accent-dark);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}
.result-distance { color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; align-self: center; }
.result-address { grid-column: 1 / -1; color: var(--accent-dark); font-size: 12px; line-height: 1.45; text-decoration: underline; text-decoration-color: rgba(47,104,81,.25); text-underline-offset: 3px; }
.intersection-result { padding: 0; display: block; cursor: default; }
.intersection-result > .result-main { padding: 19px clamp(22px, 3vw, 34px); }
.intersection-result[aria-current="true"] > .result-main { background: var(--accent-soft); }
.intersection-hint {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 10px;
  text-decoration: none;
}
.intersection-shops {
  border-top: 1px solid var(--line);
  background: rgba(247, 248, 244, .72);
}
.intersection-shops-heading {
  min-height: 38px;
  padding: 0 clamp(22px, 3vw, 34px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}
.intersection-shop {
  position: relative;
  min-height: 82px;
  padding: 0 54px 0 clamp(30px, 4vw, 46px);
  border-top: 1px solid rgba(215, 220, 212, .72);
  display: grid;
  align-items: stretch;
}
.intersection-shop-main {
  min-width: 0;
  padding: 13px 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.intersection-shop-main strong { display: block; color: var(--ink); font-size: 12px; line-height: 1.35; }
.intersection-shop-main span { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.intersection-shop-main small { display: block; margin-top: 5px; color: var(--accent-dark); font-size: 9px; }
.intersection-shop .favorite-toggle { top: 24px; }
.intersection-shop .result-review-status { display: inline-flex; margin-top: 6px; }
.intersection-loading,
.intersection-error,
.intersection-empty { padding: 18px clamp(22px, 3vw, 34px); color: var(--muted); font-size: 11px; }
.intersection-error { color: var(--danger); }
@keyframes result-in { to { opacity: 1; transform: translateY(0); } }

.empty-state, .preview-empty {
  min-height: 340px;
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
  color: var(--muted);
}
.empty-state svg, .preview-empty svg {
  width: 38px;
  fill: none;
  stroke: #9aa198;
  stroke-width: 1.35;
  stroke-linecap: round;
  stroke-linejoin: round;
  margin-bottom: 14px;
}
.empty-state strong, .preview-empty strong { color: var(--ink); font-size: 13px; margin-bottom: 5px; }
.empty-state span, .preview-empty span { font-size: 11px; }
.preview-icon {
  width: 70px;
  height: 70px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  background: var(--bg);
  border: 1px solid var(--line);
  margin-bottom: 17px;
}
.preview-icon svg { margin: 0; }

.preview-content { width: 100%; max-width: 760px; margin: 0 auto; }
.image-frame {
  position: relative;
  aspect-ratio: 16 / 10.5;
  border-radius: 22px;
  overflow: hidden;
  background: #e8ebe5;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.image-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.image-skeleton {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, #e7eae4 30%, #f4f6f2 50%, #e7eae4 70%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite;
}
@keyframes shimmer { to { background-position-x: -200%; } }
.demo-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 7px 9px;
  border-radius: 8px;
  background: rgba(32, 35, 31, .78);
  color: white;
  backdrop-filter: blur(8px);
  font-size: 10px;
  font-weight: 700;
}
.preview-details {
  padding: 24px 3px 0;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 24px;
}
.preview-details h2 { font-size: clamp(24px, 3vw, 34px); }
.preview-details p:not(.eyebrow) { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.maps-link {
  color: var(--accent-dark);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 3px;
  border-bottom: 1px solid rgba(47,104,81,.3);
  font-size: 12px;
  font-weight: 720;
  white-space: nowrap;
}
.maps-link svg { width: 15px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s ease; }
.maps-link:hover svg { transform: translate(2px, -2px); }
.inline-alert { margin-top: 18px; padding: 12px 14px; border-radius: 10px; background: #f4e7e4; color: var(--danger); font-size: 11px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  padding: 11px 15px;
  border-radius: 10px;
  background: #252a26;
  color: white;
  box-shadow: 0 18px 40px -18px rgba(20, 30, 23, .5);
  font-size: 12px;
  z-index: 10;
}

.skeleton-row {
  height: 96px;
  border-bottom: 1px solid var(--line);
  padding: 22px clamp(22px, 3vw, 34px);
}
.skeleton-line { height: 10px; border-radius: 6px; background: #e2e5df; margin-bottom: 12px; animation: pulse 1.2s ease-in-out infinite alternate; }
.skeleton-line:first-child { width: 54%; }
.skeleton-line:last-child { width: 82%; opacity: .75; }
@keyframes pulse { to { opacity: .45; } }

@media (max-width: 1050px) {
  .workspace { grid-template-columns: 330px 1fr; }
  .search-column { grid-row: 1 / span 2; }
  .results-column { border-right: 0; }
  .preview-column { border-top: 1px solid var(--line); min-height: 520px; }
}

@media (max-width: 720px) {
  .topbar { height: 60px; padding: 0 16px; }
  .brand-mark { width: 30px; height: 30px; }
  .budget-pill { padding: 0 9px; }
  .budget-pill #budgetLabel { display: none; }
  .budget-panel { top: 60px; }
  .budget-panel-inner { grid-template-columns: 1fr; gap: 15px; }
  .usage-list { grid-template-columns: 1fr; gap: 12px; }
  .workspace { display: block; min-height: auto; }
  .search-column, .results-column, .preview-column { border-right: 0; }
  .search-column { padding: 34px 18px 28px; border-bottom: 1px solid var(--line); }
  .section-heading { margin-bottom: 26px; }
  .results-column { padding: 30px 0 0; }
  .preview-column { padding: 30px 18px 46px; min-height: 390px; border-top: 1px solid var(--line); }
  .preview-details { grid-template-columns: 1fr; gap: 16px; }
  .maps-link { justify-self: start; }
  .empty-state { min-height: 230px; }
  .preview-empty { min-height: 300px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}

/* Layout v2: fixed desktop workspace with independent result scrolling. */
body { overflow: hidden; }

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.itinerary-pill,
.favorites-pill,
.preview-favorite {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  height: 36px;
  border-radius: 999px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 680;
  transition: transform .2s ease, border-color .2s ease, background .2s ease, color .2s ease;
}

.itinerary-pill:hover,
.favorites-pill:hover,
.preview-favorite:hover { border-color: #b7c1b6; }
.itinerary-pill:active,
.favorites-pill:active,
.preview-favorite:active { transform: scale(.98); }
.itinerary-pill svg,
.favorites-pill svg,
.preview-favorite svg {
  width: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.itinerary-pill strong,
.favorites-pill strong {
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--bg);
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}
.itinerary-pill.is-active,
.favorites-pill.is-active,
.preview-favorite.is-favorite {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
}
.itinerary-pill.is-active svg,
.favorites-pill.is-active svg,
.preview-favorite.is-favorite svg { fill: currentColor; }

.workspace {
  height: calc(100dvh - 68px);
  min-height: 0;
  grid-template-columns: 330px 420px minmax(0, 1fr);
  overflow: hidden;
}

.search-column {
  height: 100%;
  overflow-y: auto;
  padding: 32px 30px;
}
.section-heading { margin-bottom: 26px; }
h1 { font-size: clamp(28px, 2.5vw, 36px); }
form { gap: 20px; }

.results-column {
  height: 100%;
  min-height: 0;
  padding: 28px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.results-header {
  flex: 0 0 auto;
  padding: 0 28px 18px;
}
.results-list {
  flex: 1 1 auto;
  min-height: 0;
  display: block;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.favorite-region { border-top: 1px solid var(--line); }
.favorite-region:first-child { border-top: 0; }
.favorite-region-heading {
  width: 100%;
  position: sticky;
  top: 0;
  z-index: 1;
  min-height: 38px;
  padding: 0 20px 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  border-left: 0;
  border-right: 0;
  border-top: 0;
  background: rgba(244, 245, 241, .96);
  backdrop-filter: blur(10px);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: background .2s ease;
}
.favorite-region-heading:hover { background: rgba(237, 241, 235, .98); }
.favorite-region-heading:active { background: var(--accent-soft); }
.favorite-region-heading strong { font-size: 12px; letter-spacing: -.01em; }
.favorite-region-heading span { color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.favorite-region-meta { display: inline-flex; align-items: center; gap: 8px; }
.favorite-region-meta svg {
  width: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .2s cubic-bezier(.16, 1, .3, 1);
}
.favorite-region-heading[aria-expanded="true"] .favorite-region-meta svg { transform: rotate(90deg); }
.favorite-region-items[hidden] { display: none; }

.result-item {
  position: relative;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  padding: 0;
  display: block;
  cursor: default;
  opacity: 0;
  transform: translateY(8px);
  animation: result-in .38s cubic-bezier(.16,1,.3,1) forwards;
  animation-delay: calc(var(--index) * 35ms);
  transition: background .2s ease;
}
.result-item:hover,
.result-item[aria-current="true"] { background: var(--accent-soft); }
.result-item:active { transform: none; }

.result-main {
  width: 100%;
  min-height: 84px;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  padding: 15px 54px 15px 28px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px 12px;
  cursor: pointer;
}
.result-main:active { transform: translateY(1px); }
.result-name { align-self: center; }
.result-address { grid-column: 1 / -1; }

.favorite-toggle {
  position: absolute;
  top: 14px;
  right: 17px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: transparent;
  color: #929990;
  cursor: pointer;
  transition: color .2s ease, background .2s ease, transform .2s ease;
}
.favorite-toggle:hover { color: var(--accent-dark); background: rgba(255,255,255,.6); }
.favorite-toggle:active { transform: scale(.92); }
.favorite-toggle svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.favorite-toggle.is-favorite { color: var(--accent); }
.favorite-toggle.is-favorite svg { fill: currentColor; }

.empty-state {
  flex: 1 1 auto;
  min-height: 0;
}

.preview-column {
  height: 100%;
  min-height: 0;
  padding: 28px 34px;
  display: block;
  overflow-y: auto;
  background: var(--surface);
}
.preview-empty {
  width: 100%;
  height: 100%;
  min-height: 0;
}
.preview-content {
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
}
.preview-details {
  padding-top: 18px;
  align-items: center;
}
.preview-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}
.preview-favorite { height: 38px; border-radius: 11px; }
.maps-link { min-height: 38px; align-items: center; }

@media (max-width: 1180px) {
  body { overflow: auto; }
  .workspace {
    height: auto;
    min-height: calc(100dvh - 68px);
    grid-template-columns: 300px minmax(0, 1fr);
    overflow: visible;
  }
  .search-column { grid-row: 1 / span 2; height: auto; overflow: visible; }
  .results-column { height: 620px; border-right: 0; }
  .preview-column { grid-column: 2; height: auto; min-height: 520px; border-top: 1px solid var(--line); }
  .preview-empty { min-height: 420px; }
}

@media (max-width: 720px) {
  body { overflow: auto; }
  .top-actions { gap: 5px; }
  .favorites-pill { padding: 0 8px; }
  .favorites-pill > span { display: none; }
  .workspace { display: block; height: auto; min-height: auto; }
  .search-column, .results-column, .preview-column { height: auto; overflow: visible; }
  .search-column { padding: 28px 18px 24px; }
  .results-column { padding-top: 26px; }
  .results-list { overflow: visible; }
  .result-main { padding-left: 20px; }
  .preview-column { min-height: 390px; padding: 24px 18px 38px; }
  .preview-empty { min-height: 320px; }
  .preview-actions { justify-content: flex-start; flex-wrap: wrap; }
  body.favorites-view .search-column { display: none; }
  body.favorites-view .workspace { min-height: calc(100dvh - 60px); }
  body.favorites-view .results-column { min-height: calc(100dvh - 60px); padding-top: 22px; }
  body.favorites-view .favorites-pill > span { display: inline; }
  body.favorites-view .budget-pill { display: none; }
  .favorite-region-heading { top: 60px; padding-left: 20px; }
}

/* MVP+ practical controls. */
select,
input[type="number"],
input[type="search"] {
  width: 100%;
  height: 48px;
  border: 1px solid #d5d9d2;
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 14px;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}
select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #778076 50%), linear-gradient(135deg, #778076 50%, transparent 50%);
  background-position: calc(100% - 18px) 21px, calc(100% - 13px) 21px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}
select:focus,
input[type="number"]:focus,
input[type="search"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
select[aria-invalid="true"],
input[type="number"][aria-invalid="true"] { border-color: var(--danger); }

.custom-radius {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
}
.custom-radius > span { color: var(--muted); font-size: 11px; font-weight: 650; }
.custom-radius input { height: 40px; }
.custom-radius em { color: var(--muted); font-style: normal; font-size: 11px; }

.history-panel {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.history-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 14px;
  margin-bottom: 12px;
}
.history-heading h2 { font-size: 17px; }
.history-heading button,
.result-tools button {
  border: 0;
  background: transparent;
  color: var(--accent-dark);
  padding: 5px 0;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}
.history-list {
  max-height: 210px;
  display: grid;
  overflow-y: auto;
  border-top: 1px solid var(--line);
}
.history-empty { padding: 16px 0; color: var(--muted); font-size: 11px; }
.history-item {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  padding: 11px 2px;
  display: grid;
  gap: 5px;
  text-align: left;
  cursor: pointer;
  transition: color .2s ease, transform .2s ease;
}
.history-item:hover { color: var(--accent-dark); }
.history-item:active { transform: translateY(1px); }
.history-item > span { display: flex; justify-content: space-between; gap: 12px; }
.history-item strong { font-size: 12px; }
.history-item em { color: var(--accent); font-style: normal; font-size: 10px; font-weight: 700; }
.history-item small { color: var(--muted); font-size: 10px; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.result-tools {
  flex: 0 0 auto;
  height: 50px;
  padding: 7px 20px 7px 28px;
  display: grid;
  grid-template-columns: 18px 1fr auto;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  background: rgba(251,252,249,.75);
}
.result-tools svg {
  width: 17px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.7;
  stroke-linecap: round;
}
.result-tools input {
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  padding: 0 4px;
  box-shadow: none;
  font-size: 12px;
}
.result-tools input:focus { box-shadow: none; }

@media (max-width: 720px) {
  .history-panel { margin-top: 24px; }
  .history-list { max-height: 170px; }
  .result-tools { padding-left: 20px; }
}

.result-tools { grid-template-columns: 18px minmax(0, 1fr) auto auto auto auto auto auto; }
.result-tools .itinerary-plan-toggle,
.result-tools .intersection-toggle,
.result-tools .map-toggle,
.result-tools .photo-wall-toggle {
  min-width: 84px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--muted);
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  transition: border-color .2s ease, background .2s ease, color .2s ease, transform .2s ease;
}
.result-tools .itinerary-plan-toggle { min-width: 72px; }
.result-tools .map-toggle { min-width: 62px; }
.result-tools .photo-wall-toggle { min-width: 72px; }
.result-tools .itinerary-plan-toggle:hover,
.result-tools .intersection-toggle:hover,
.result-tools .map-toggle:hover,
.result-tools .photo-wall-toggle:hover { border-color: #b7c1b6; color: var(--accent-dark); }
.result-tools .itinerary-plan-toggle:active,
.result-tools .intersection-toggle:active,
.result-tools .map-toggle:active,
.result-tools .photo-wall-toggle:active { transform: scale(.97); }
.result-tools .itinerary-plan-toggle:disabled,
.result-tools .intersection-toggle:disabled,
.result-tools .map-toggle:disabled,
.result-tools .photo-wall-toggle:disabled { cursor: wait; opacity: .65; }
.result-tools .itinerary-plan-toggle.is-active,
.result-tools .intersection-toggle.is-active,
.result-tools .map-toggle.is-active,
.result-tools .photo-wall-toggle.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
}
.result-tools .itinerary-plan-toggle svg,
.result-tools .intersection-toggle svg,
.result-tools .map-toggle svg,
.result-tools .photo-wall-toggle svg { width: 15px; stroke: currentColor; fill: none; }

.result-review-status {
  grid-column: 1 / -1;
  width: fit-content;
  padding: 3px 7px;
  border-radius: 6px;
  background: #ecefea;
  color: var(--muted);
  font-size: 9px;
  font-weight: 720;
}
.result-review-status[data-status="keep"] { background: var(--accent-soft); color: var(--accent-dark); }
.result-review-status[data-status="pending"] { background: #f2ead8; color: #775d21; }
.result-review-status[data-status="rejected"] { background: #f2e5e2; color: var(--danger); }
.result-traffic-anchor {
  grid-column: 1 / -1;
  width: fit-content;
  max-width: 100%;
  padding: 4px 7px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 7px;
  background: #edf1e7;
  color: #4f6245;
  font-size: 9px;
  font-weight: 720;
}
.result-traffic-anchor svg { width: 13px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.result-traffic-anchor span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.result-brand-badge {
  grid-column: 1 / -1;
  display: inline-block;
  width: fit-content;
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 9px;
  font-weight: 720;
  background: #d9e6f5;
  color: #29527a;
}

.closed-weekday-badge {
  grid-column: 1 / -1;
  width: fit-content;
  padding: 4px 8px;
  border-radius: 7px;
  background: #e9dfc9;
  color: #725523;
  font-size: 10px;
  font-weight: 800;
}
.closed-weekday-evidence {
  grid-column: 1 / -1;
  color: #5f695f;
  font-size: 9px;
  line-height: 1.45;
}
.closed-weekday-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 9px;
}
.closed-weekday-checks label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font-size: 11px;
  cursor: pointer;
}
.closed-weekday-checks input { accent-color: var(--accent); }
.closed-weekday-count {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  color: var(--ink);
  font-size: 11px;
}
.closed-weekday-count select {
  min-width: 108px;
}
.closed-weekday-time {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  color: var(--ink);
  font-size: 11px;
}
.closed-weekday-time input[type="time"] {
  width: 100%;
  min-width: 0;
  height: 38px;
  border: 1px solid #d5d9d2;
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 10px;
}
.closed-weekday-time em {
  color: var(--muted);
  font-size: 9px;
  font-style: normal;
  white-space: nowrap;
}

.auth-locked { overflow: hidden; }
.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(28, 34, 29, .42);
  backdrop-filter: blur(10px);
}
.auth-modal[hidden] { display: none; }
.auth-card {
  width: min(100%, 390px);
  padding: 32px;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 24px;
  background: rgba(252, 253, 250, .98);
  box-shadow: 0 28px 80px rgba(20, 35, 26, .24);
}
.auth-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  margin-bottom: 20px;
  border-radius: 13px;
  background: var(--accent);
  color: #fff;
  font-size: 25px;
  font-weight: 800;
}
.auth-card h2 { margin-bottom: 10px; }
.auth-intro { margin-bottom: 24px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.auth-form { display: grid; gap: 15px; }
.auth-form label:not(.auth-remember) { display: grid; gap: 7px; }
.auth-form label > span { color: var(--ink); font-size: 11px; font-weight: 700; }
.auth-form input[type="text"],
.auth-form input[type="password"] {
  width: 100%;
  height: 46px;
  border: 1px solid #d5d9d2;
  border-radius: 11px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 13px;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.auth-form input[type="text"]:focus,
.auth-form input[type="password"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.auth-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
}
.auth-remember input { accent-color: var(--accent); }
.auth-form .search-button { width: 100%; margin-top: 3px; }
.auth-form .inline-alert { margin-top: 0; }

.market-score-badge {
  grid-column: 1 / -1;
  width: fit-content;
  padding: 4px 8px;
  border-radius: 7px;
  background: #f3dfb0;
  color: #755719;
  font-size: 10px;
  font-weight: 800;
}
.market-evidence {
  grid-column: 1 / -1;
  color: #5f695f;
  font-size: 9px;
  line-height: 1.45;
}

.market-options {
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(229, 238, 232, .46);
}
.market-option-grid {
  margin-top: 9px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}
.market-option-grid label { display: grid; gap: 5px; }
.market-option-grid label > span { color: var(--muted); font-size: 9px; }
.market-option-grid select {
  width: 100%;
  min-height: 31px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--accent-dark);
  padding: 0 6px;
  font-size: 10px;
  font-weight: 700;
}
.market-custom-input {
  width: 100%;
  min-height: 31px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--accent-dark);
  padding: 0 8px;
  font-size: 10px;
  font-weight: 700;
}
.market-options > small { display: block; margin-top: 9px; color: var(--muted); font-size: 9px; line-height: 1.4; }

.favorite-category-badges {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.favorite-category-badges span {
  padding: 3px 6px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 9px;
  font-weight: 720;
}

.photo-wall-content {
  width: 100%;
  height: 100%;
  min-height: 520px;
  display: flex;
  flex-direction: column;
}
.photo-wall-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}
.photo-wall-heading h2 { font-size: clamp(24px, 3vw, 34px); }
.photo-wall-heading > span,
.photo-wall-tools > span { color: var(--muted); font-size: 11px; white-space: nowrap; }
.photo-wall-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.photo-wall-tools label { display: flex; align-items: center; gap: 8px; }
.photo-wall-tools label > span { color: var(--muted); font-size: 10px; font-weight: 700; }
.photo-wall-tools select { width: auto; min-width: 130px; height: 34px; border-radius: 9px; font-size: 11px; }
.photo-wall-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.photo-wall-empty {
  grid-column: 1 / -1;
  min-height: 220px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 11px;
}
.photo-wall-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  box-shadow: 0 12px 30px -24px rgba(37, 53, 43, .45);
  transition: transform .2s ease, border-color .2s ease;
}
.photo-wall-card:hover { transform: translateY(-2px); border-color: #bac4b9; }
.photo-wall-card[data-status="rejected"] { opacity: .62; }
.photo-wall-image {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10.5;
  border: 0;
  overflow: hidden;
  background: #e5e9e2;
  cursor: pointer;
  padding: 0;
  display: block;
}
.photo-wall-image img { width: 100%; height: 100%; display: block; object-fit: cover; }
.photo-wall-skeleton {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, #e2e6df 20%, #f1f3ef 40%, #e2e6df 60%);
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
}
.photo-wall-number,
.photo-wall-badge {
  position: absolute;
  top: 8px;
  padding: 5px 7px;
  border-radius: 7px;
  background: rgba(32, 35, 31, .8);
  color: white;
  backdrop-filter: blur(8px);
  font-size: 9px;
  font-weight: 750;
}
.photo-wall-number { left: 8px; }
.photo-wall-badge { right: 8px; }
.photo-wall-badge[data-status="keep"] { background: rgba(37, 82, 63, .9); }
.photo-wall-badge[data-status="pending"] { background: rgba(119, 93, 33, .9); }
.photo-wall-badge[data-status="rejected"] { background: rgba(164, 71, 59, .9); }
.photo-wall-info { padding: 10px 11px 12px; display: grid; gap: 4px; }
.photo-wall-info strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.photo-wall-info span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 9px; }
.photo-wall-error { position: absolute; inset: 0; padding: 12px; display: grid; place-items: center; color: var(--danger); font-size: 10px; text-align: center; }
.photo-wall-more {
  width: 100%;
  min-height: 42px;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  color: var(--accent-dark);
  cursor: pointer;
  font-size: 11px;
  font-weight: 720;
}
.photo-wall-more:hover { border-color: #b7c1b6; }
.photo-wall-more:active { transform: translateY(1px); }

.review-console {
  margin-top: 16px;
  padding: 12px 0 14px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.review-navigation {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
}
.review-navigation > div { min-width: 0; display: grid; justify-items: center; gap: 2px; }
.review-navigation span { color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.review-navigation strong { font-size: 12px; }
.review-navigation button,
.review-actions button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  padding: 0 11px;
  font-size: 11px;
  font-weight: 700;
}
.review-navigation button:disabled,
.review-actions button:disabled { cursor: default; opacity: .45; }
.review-navigation button:active,
.review-actions button:active { transform: scale(.97); }
.review-actions {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 7px;
}
.review-actions button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.review-actions button.is-active[data-review-status="keep"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); }
.review-actions button.is-active[data-review-status="pending"] { border-color: #c7ae6d; background: #f2ead8; color: #775d21; }
.review-actions button.is-active[data-review-status="rejected"] { border-color: #cc9188; background: #f2e5e2; color: var(--danger); }
.review-actions .review-clear { color: var(--muted); }
.review-actions kbd { padding: 1px 4px; border: 1px solid currentColor; border-radius: 4px; font: inherit; font-size: 8px; opacity: .65; }
.review-shortcuts { display: block; margin-top: 8px; color: var(--muted); text-align: center; font-size: 9px; }

.map-content {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 520px;
  display: flex;
  flex-direction: column;
}
.map-content[hidden] { display: none; }
.map-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}
.map-heading h2 { font-size: clamp(24px, 3vw, 34px); }
.map-heading > span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.results-map {
  flex: 1 1 auto;
  width: 100%;
  min-height: 440px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--bg);
  color: var(--muted);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow);
}
.map-info { max-width: 220px; color: #1f2923; line-height: 1.45; }
.map-info strong { display: block; margin-bottom: 4px; font-size: 13px; }
.map-info span { color: #667068; font-size: 11px; }
.map-place-card {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 22px;
  z-index: 2;
  max-width: 650px;
  min-height: 128px;
  margin: 0 auto;
  padding: 12px 48px 12px 12px;
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: 16px;
  border: 1px solid rgba(207, 213, 205, .9);
  border-radius: 17px;
  background: rgba(251, 252, 249, .97);
  box-shadow: 0 18px 50px rgba(31, 41, 35, .22);
  backdrop-filter: blur(14px);
}
.map-place-card[hidden] { display: none; }
.map-place-image {
  position: relative;
  min-height: 104px;
  overflow: hidden;
  border-radius: 12px;
  background: #e7ebe5;
}
.map-place-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.map-image-skeleton { position: absolute; inset: 0; background: linear-gradient(100deg, #e2e6df 20%, #f1f3ef 40%, #e2e6df 60%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.map-place-details { min-width: 0; align-self: center; }
.map-place-details .eyebrow { margin-bottom: 4px; font-size: 9px; }
.map-place-details h3 { margin: 0 0 5px; font-size: 19px; line-height: 1.2; }
.map-place-details > p:not(.eyebrow) { margin: 0 0 5px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.map-place-details > span { display: block; margin-bottom: 8px; color: var(--accent-dark); font-size: 10px; font-weight: 700; }
.map-place-details .maps-link { width: fit-content; min-height: 30px; font-size: 11px; }
.map-place-close {
  position: absolute;
  top: 9px;
  right: 11px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}
.map-place-close:hover { background: var(--bg); color: var(--ink); }
.result-intersection {
  grid-column: 1 / -1;
  width: fit-content;
  max-width: 100%;
  padding: 4px 7px;
  border-radius: 6px;
  background: rgba(47, 104, 81, .1);
  color: var(--accent-dark);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .market-option-grid { grid-template-columns: 1fr; }
  .result-tools {
    height: auto;
    min-height: 50px;
    grid-template-columns: 18px minmax(0, 1fr) auto auto;
  }
  .result-tools .intersection-toggle {
    grid-column: 1 / 3;
    justify-self: stretch;
    margin: 0 0 3px;
  }
  .result-tools .map-toggle {
    grid-column: 3;
    justify-self: stretch;
    margin: 0 0 3px;
  }
  .result-tools .photo-wall-toggle {
    grid-column: 4;
    justify-self: stretch;
    margin: 0 0 3px;
  }
  .photo-wall-content { min-height: 420px; }
  .photo-wall-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .review-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .review-actions .review-clear { grid-column: 1 / -1; }
  .map-content { min-height: 500px; }
  .results-map { min-height: 420px; border-radius: 16px; }
  .map-place-card {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    grid-template-columns: 112px minmax(0, 1fr);
    min-height: 118px;
    margin-top: 12px;
    padding-right: 38px;
    border-radius: 14px;
  }
  .map-place-image { min-height: 92px; }
  .map-place-details h3 { font-size: 16px; }
}

.favorite-tracking {
  margin: -4px 54px 12px 28px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}
.visit-status {
  width: fit-content;
  min-height: 30px;
  margin: 0;
  padding: 0 8px;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--muted);
  transition: border-color .2s ease, background .2s ease, color .2s ease, transform .2s ease;
}
.visit-status:active { transform: scale(.98); }
.visit-status::after {
  content: "";
  width: 5px;
  height: 5px;
  margin-left: -15px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  pointer-events: none;
}
.visit-status svg {
  width: 16px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.visit-status .visit-icon-check,
.visit-status .visit-icon-x { display: none; }
.visit-status[data-status="visited"] .visit-icon-circle,
.visit-status[data-status="success"] .visit-icon-circle,
.visit-status[data-status="rejected"] .visit-icon-circle,
.visit-status[data-status="unsuitable"] .visit-icon-circle { display: none; }
.visit-status[data-status="visited"] .visit-icon-check,
.visit-status[data-status="success"] .visit-icon-check,
.visit-status[data-status="rejected"] .visit-icon-x,
.visit-status[data-status="unsuitable"] .visit-icon-x { display: block; }
.visit-status[data-status="visited"] {
  border-color: #b7cbbf;
  background: var(--accent-soft);
  color: var(--accent-dark);
}
.visit-status[data-status="success"] {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}
.visit-status[data-status="rejected"] {
  border-color: #d7ccc6;
  background: #f1eeeb;
  color: #765f57;
}
.visit-status[data-status="unsuitable"] {
  border-color: #dfbbb5;
  background: #f6e8e5;
  color: var(--danger);
}
.visit-status .visit-status-select {
  appearance: none;
  width: auto;
  height: 28px;
  min-width: 76px;
  border: 0;
  border-radius: 0;
  background: transparent;
  background-image: none;
  color: inherit;
  padding: 0 20px 0 2px;
  outline: none;
  box-shadow: none;
  cursor: pointer;
  font-size: 11px;
  font-weight: 720;
}
.visit-status .visit-status-select:focus { box-shadow: none; }
.visit-status .visit-status-select:disabled { cursor: wait; opacity: .62; }

.favorite-note {
  min-width: 0;
  height: 30px;
  padding: 0 8px;
  display: grid;
  grid-template-columns: 15px minmax(0, 1fr);
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--muted);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.favorite-note:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.favorite-note svg {
  width: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.favorite-note .favorite-note-input {
  width: 100%;
  min-width: 0;
  height: 28px;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 0;
  outline: none;
  font-size: 11px;
}
.favorite-note .favorite-note-input::placeholder { color: #929990; }
.favorite-note .favorite-note-input:disabled { cursor: wait; opacity: .62; }

.favorite-status-filter,
.review-status-filter,
.favorite-category-filter,
.favorite-seen-filter {
  appearance: none;
  width: auto;
  min-width: 108px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background-color: var(--surface);
  background-position: calc(100% - 14px) 13px, calc(100% - 9px) 13px;
  color: var(--accent-dark);
  padding: 0 27px 0 9px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.favorite-batch-button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--accent-dark);
  cursor: pointer;
  font-size: 10px;
  font-weight: 720;
}
.favorite-batch-button:hover { border-color: var(--accent); background: var(--accent-soft); }

@media (max-width: 720px) {
  .favorite-tracking { margin-left: 20px; }
  body.favorites-view .favorite-status-filter {
    width: 100%;
    grid-column: 1 / -1;
    grid-row: 2;
    margin-bottom: 3px;
  }
  body.favorites-view .favorite-category-filter,
  body.favorites-view .favorite-seen-filter,
  body.favorites-view .favorite-batch-button {
    width: 100%;
    grid-column: 1 / -1;
    grid-row: 3;
    margin-bottom: 3px;
  }
  body.favorites-view .favorite-seen-filter { grid-row: 4; }
  body.favorites-view #favoriteMarkSeenButton { grid-row: 5; }
  body.favorites-view #favoriteKeepBreakfastButton { grid-row: 6; }
  body.favorites-view .result-tools .intersection-toggle,
  body.favorites-view .result-tools .map-toggle,
  body.favorites-view .result-tools .photo-wall-toggle { grid-row: 7; }
  body:not(.favorites-view) .review-status-filter {
    width: 100%;
    grid-column: 1 / -1;
    grid-row: 2;
    margin-bottom: 3px;
  }
  body:not(.favorites-view) .result-tools .intersection-toggle,
  body:not(.favorites-view) .result-tools .map-toggle,
  body:not(.favorites-view) .result-tools .photo-wall-toggle { grid-row: 3; }
}

/* Saved itinerary: intentionally native controls, no routing library or drag dependency. */
.itinerary-toolbar {
  flex: 0 0 auto;
  min-height: 58px;
  padding: 9px 20px 9px 28px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  background: rgba(229, 238, 232, .52);
}
.itinerary-toolbar > div { display: grid; gap: 2px; }
.itinerary-toolbar strong { font-size: 11px; }
.itinerary-toolbar > div span { color: var(--muted); font-size: 9px; }
.itinerary-toolbar label { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 7px; }
.itinerary-toolbar label > span { color: var(--muted); font-size: 10px; font-weight: 700; }
.itinerary-toolbar select {
  height: 34px;
  border-radius: 9px;
  background-position: calc(100% - 14px) 14px, calc(100% - 9px) 14px;
  padding: 0 26px 0 9px;
  font-size: 11px;
  font-weight: 700;
}
.itinerary-toolbar > button {
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--accent-dark);
  padding: 0 10px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
}
.itinerary-toolbar #itineraryClear { border-color: #d9c9c5; color: var(--danger); }
.itinerary-toolbar > button:active { transform: scale(.98); }

.itinerary-interchange-panel {
  flex: 0 0 auto;
  padding: 11px 20px 12px 28px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  align-items: end;
  gap: 9px;
  border-bottom: 1px solid var(--line);
  background: rgba(251, 252, 249, .92);
}
.itinerary-interchange-panel label { min-width: 0; display: grid; gap: 5px; }
.itinerary-interchange-panel label > span { color: var(--muted); font-size: 9px; font-weight: 720; }
.itinerary-interchange-panel input[type="text"] { height: 38px; border-radius: 9px; padding: 0 10px; font-size: 11px; }
.itinerary-interchange-panel > button {
  height: 38px;
  border: 0;
  border-radius: 9px;
  background: var(--accent);
  color: white;
  padding: 0 12px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 720;
  white-space: nowrap;
}
.itinerary-interchange-panel > button:active { transform: scale(.98); }
.itinerary-interchange-panel > button:disabled { cursor: wait; opacity: .62; }

.itinerary-check {
  position: absolute;
  z-index: 1;
  top: 19px;
  left: 24px;
  width: 28px;
  height: 28px;
  cursor: pointer;
}
.itinerary-check input { position: absolute; opacity: 0; pointer-events: none; }
.itinerary-check span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid #cdd3cb;
  border-radius: 9px;
  background: var(--surface);
  color: transparent;
  transition: background .2s ease, border-color .2s ease, color .2s ease, transform .2s ease;
}
.itinerary-check span:active { transform: scale(.94); }
.itinerary-check svg { width: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.itinerary-check input:checked + span { border-color: var(--accent); background: var(--accent); color: white; }
.itinerary-check input:focus-visible + span { outline: 3px solid var(--accent-soft); }
.result-item.is-selecting .result-main { padding-left: 66px; }

.itinerary-selection-bar {
  position: fixed;
  z-index: 8;
  left: 50%;
  bottom: 18px;
  width: min(620px, calc(100% - 28px));
  min-height: 54px;
  padding: 8px 9px 8px 16px;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: minmax(92px, 1fr) auto auto auto;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(47, 104, 81, .28);
  border-radius: 15px;
  background: rgba(251, 252, 249, .96);
  box-shadow: 0 20px 44px -24px rgba(32, 48, 39, .48), inset 0 1px 0 rgba(255,255,255,.8);
  backdrop-filter: blur(14px);
}
.itinerary-selection-bar strong { font-size: 12px; font-variant-numeric: tabular-nums; }
.itinerary-selection-bar button {
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 11px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}
.itinerary-selection-bar button:active { transform: scale(.98); }
.itinerary-selection-bar button.primary { border-color: var(--accent); background: var(--accent); color: white; }
.itinerary-selection-bar button:disabled { cursor: default; opacity: .45; }
body.itinerary-selecting .results-list { padding-bottom: 88px; }

.itinerary-item { cursor: grab; }
.itinerary-item.is-dragging { opacity: .42; }
.itinerary-item.is-drop-target { box-shadow: inset 0 3px 0 var(--accent); }
.itinerary-item .result-main { min-height: 76px; padding-right: 28px; }
.itinerary-item .result-name { grid-column: 1; }
.itinerary-start-label {
  align-self: center;
  justify-self: end;
  color: var(--accent-dark);
  font-size: 9px;
  font-weight: 760;
}
.itinerary-item.is-start { background: rgba(229, 238, 232, .42); }
.itinerary-row-actions {
  margin: -2px 28px 13px;
  display: flex;
  align-items: center;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: none;
}
.itinerary-row-actions::-webkit-scrollbar { display: none; }
.itinerary-row-actions a,
.itinerary-row-actions button {
  min-width: max-content;
  height: 29px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
}
.itinerary-row-actions a { border-color: var(--accent); color: var(--accent-dark); }
.itinerary-row-actions .danger { color: var(--danger); }
.itinerary-row-actions button:disabled { opacity: .35; cursor: default; }
.itinerary-row-actions a:active,
.itinerary-row-actions button:active { transform: scale(.97); }

.route-marker {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border: 2px solid white;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  box-shadow: 0 7px 15px -8px rgba(25, 52, 40, .8);
  font-size: 11px;
  font-weight: 800;
}
.route-endpoint-marker {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 2px solid white;
  border-radius: 11px;
  background: #36443d;
  color: white;
  box-shadow: 0 7px 15px -8px rgba(25, 52, 40, .8);
  font-size: 11px;
  font-weight: 800;
}
.route-endpoint-marker.is-end { background: #a4473b; }

@media (max-width: 720px) {
  .itinerary-pill { padding: 0 8px; }
  .itinerary-pill > span { display: none; }
  body.itinerary-view .search-column { display: none; }
  body.itinerary-view .workspace { min-height: calc(100dvh - 60px); }
  body.itinerary-view .results-column { min-height: calc(100dvh - 60px); padding-top: 22px; }
  body.itinerary-view .itinerary-pill > span { display: inline; }
  body.itinerary-view .budget-pill { display: none; }
  .itinerary-toolbar { padding-left: 20px; grid-template-columns: 1fr auto; }
  .itinerary-toolbar > div { grid-column: 1 / -1; }
  .itinerary-toolbar label { min-width: 0; }
  .itinerary-toolbar select { min-width: 0; }
  .itinerary-interchange-panel { padding-left: 20px; grid-template-columns: 1fr; }
  .itinerary-selection-bar {
    bottom: 10px;
    padding-left: 10px;
    grid-template-columns: 1fr 1fr 1fr;
  }
  .itinerary-selection-bar strong { grid-column: 1 / -1; }
  .itinerary-selection-bar button { padding: 0 7px; }
  .itinerary-check { left: 16px; }
  .result-item.is-selecting .result-main { padding-left: 58px; }
  .itinerary-row-actions { margin-left: 20px; margin-right: 20px; }
  body.favorites-view .result-tools .itinerary-plan-toggle {
    grid-column: 1 / 3;
    justify-self: stretch;
    margin: 0 0 3px;
  }
  body.favorites-view .result-tools .map-toggle { grid-column: 3 / 5; }
}
