.nearby-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .8fr);
  align-items: center;
  gap: clamp(30px, 6vw, 88px);
  padding-block: 35px 52px;
}

.nearby-copy {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  max-width: 555px;
  min-width: 0;
}

.nearby-page .nearby-copy h1 { max-width: 13ch; }
.nearby-page .nearby-copy .lead { max-width: 39ch; }

.nearby-steps {
  list-style: none;
  display: grid;
  gap: 12px;
  max-width: 400px;
  margin: 30px 0 0;
  padding: 3px 0 3px 15px;
  border-inline-start: 1px solid var(--line);
  color: var(--dim);
}

.nearby-steps li { min-width: 0; font-size: .88rem; line-height: 1.4; }
.nearby-steps strong { display: block; color: var(--ink); font-weight: 720; }
.nearby-steps small { display: block; margin-top: 2px; font-size: .82rem; }
.nearby-steps li[aria-current] strong { color: var(--accent); }
.nearby-stage { --device-width: 350px; gap: 8px; }
.nearby-slot { width: min(100%, var(--device-width)); }
.nearby-slot:empty { aspect-ratio: 888 / 1832; }
.nearby-caption {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 11px;
  color: var(--dim);
  font-size: .78rem;
  font-weight: 620;
  text-align: center;
}

.nearby-page .phone-main {
  gap: 0;
  padding: 0 3.3cqw 1.6cqw;
  overflow: hidden;
}

.nearby-app {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.nearby-scroll {
  display: grid;
  flex: 1;
  align-content: start;
  gap: 2.1cqw;
  min-height: 0;
  padding: 2px 2px 2.1cqw;
  overflow: auto;
  scrollbar-width: thin;
}

.nearby-page .phone-main h2 {
  font-size: max(1.05rem, 6cqw);
  line-height: 1.1;
  letter-spacing: -.042em;
  overflow-wrap: anywhere;
}

.nearby-page .phone-main h3 {
  font-size: max(.92rem, 4.5cqw);
  line-height: 1.14;
  letter-spacing: -.023em;
  overflow-wrap: anywhere;
}

.nearby-heading { display: grid; gap: 1cqw; }
.nearby-meta, .nearby-note {
  color: var(--dim);
  font-size: max(.72rem, 3.55cqw);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.nearby-search {
  display: flex;
  align-items: center;
  gap: 1.75cqw;
  min-width: 0;
}

.nearby-search input {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 0 3.3cqw;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: .88rem;
}
.nearby-search input::placeholder { color: var(--dim); }

.nearby-search button,
.nearby-filters :is(button, select),
.nearby-view {
  min-height: 41px;
  min-width: 0;
  padding: 4px 2.5cqw;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: max(.75rem, 3.5cqw);
  font-weight: 700;
  line-height: 1.15;
}

.nearby-search button {
  min-height: 44px;
  flex-shrink: 0;
  padding-inline: 3.1cqw;
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
}

.nearby-filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
  gap: 1.4cqw 1.7cqw;
}

.nearby-filters > label,
.nearby-filter-select { display: grid; gap: 1px; min-width: 0; color: var(--dim); font-size: max(.65rem, 3.15cqw); font-weight: 650; }
.nearby-filters select {
  appearance: none;
  width: 100%;
  padding-inline: 3cqw max(23px, 7cqw);
  text-overflow: ellipsis;
}
.nearby-filter-select { position: relative; }
.nearby-filter-select::after {
  content: '';
  position: absolute;
  inset-inline-end: max(10px, 3cqw);
  inset-block-end: 17px;
  width: .43rem;
  height: .43rem;
  transform: rotate(45deg);
  border: solid var(--dim);
  border-width: 0 1.5px 1.5px 0;
  pointer-events: none;
}
.nearby-filters button { text-wrap: balance; }
.nearby-filters button[aria-pressed="true"], .nearby-toolbar button[aria-pressed="true"] {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 15%, var(--card));
  color: var(--ink);
}

.nearby-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 7px;
}
.nearby-results-count { min-width: 0; color: var(--dim); font-size: max(.72rem, 3.55cqw); font-weight: 680; }
.nearby-view { min-height: 44px; border-color: transparent; background: transparent; color: var(--accent); }
.nearby-view:hover, .nearby-filters button:hover { border-color: var(--accent); }
[data-nearby-results] { display: grid; align-content: start; gap: 1.6cqw; min-width: 0; }

.nearby-canvas {
  position: relative;
  isolation: isolate;
  border: 1px solid var(--line);
  border-radius: 5.2cqw;
  overflow: hidden;
  background: var(--quiet);
}

.nearby-canvas svg {
  display: block;
  width: 100%;
  height: auto;
}

.nearby-canvas .walk-map {
  --walk-map-land: #eee8d8;
  --walk-map-sea: #bddbe1;
  --walk-map-street-edge: #d3cbbb;
  --walk-map-street: #fffaf0;
}

[data-theme="dark"] .nearby-canvas .walk-map {
  --walk-map-land: #24354e;
  --walk-map-sea: #152840;
  --walk-map-street-edge: #293d59;
  --walk-map-street: #53647a;
}

.nearby-pin {
  position: absolute;
  top: var(--pin-y);
  left: var(--pin-x);
  z-index: 1;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  transform: translate(-50%, -50%);
}

.nearby-pin[aria-pressed="true"], .nearby-pin:focus-visible { z-index: 2; }
.nearby-route .nearby-pin { pointer-events: none; }
.nearby-pin:focus-visible { outline-offset: -2px; }

.nearby-pin-marker {
  display: grid;
  place-items: center;
  width: max(21px, 6.6cqw);
  aspect-ratio: 1;
  border: 2px solid var(--card);
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  box-shadow: 0 2px 6px #10182850;
  font-weight: 800;
  font-size: .625rem;
  line-height: 1;
  white-space: nowrap;
}

button.nearby-pin:hover .nearby-pin-marker,
.nearby-pin[aria-pressed="true"] .nearby-pin-marker,
.nearby-route .nearby-pin-marker {
  width: max(25px, 7.4cqw);
  background: var(--accent);
  color: var(--on-accent);
}

.nearby-pin-label {
  position: absolute;
  left: 50%;
  top: calc(50% + 13px);
  padding: 2px 6px;
  border-radius: 100px;
  background: var(--card);
  color: var(--ink);
  font-size: .65rem;
  font-weight: 740;
  line-height: 1.25;
  white-space: nowrap;
  pointer-events: none;
  transform: translateX(-50%);
}
.nearby-pin[data-nearby-place="canpaco"] .nearby-pin-label { right: 0; left: auto; transform: none; }

.nearby-selection, .nearby-empty {
  display: grid;
  gap: 1.6cqw;
  min-width: 0;
  padding: 2.6cqw;
  border: 1px solid var(--line);
  border-radius: 4.6cqw;
  background: var(--card);
}
.nearby-card-head { display: flex; align-items: center; gap: 2.8cqw; min-width: 0; }
.nearby-card-media { flex: 0 0 26%; min-width: 0; }
.nearby-card-media img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  border-radius: 2.8cqw;
  object-fit: cover;
  object-position: center 54%;
}
.nearby-card-copy { display: grid; gap: .75cqw; min-width: 0; }
.nearby-place-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: .6cqw 0;
  padding-block: 1.65cqw;
  border-block: 1px solid var(--line);
}
.nearby-place-facts > div { min-width: 0; padding-inline: 1.6cqw; }
.nearby-place-facts > div + div { border-inline-start: 1px solid var(--line); }
.nearby-place-facts dt { color: var(--dim); font-size: max(.69rem, 3.15cqw); overflow-wrap: anywhere; }
.nearby-place-facts dd { margin: .65cqw 0 0; font-size: max(.8rem, 3.85cqw); font-weight: 720; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.nearby-meta span { color: var(--accent); }
.nearby-actions {
  display: grid;
  gap: 1.5cqw;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.nearby-actions > :last-child:nth-child(odd), .nearby-route .nearby-actions > * { grid-column: 1 / -1; }
.nearby-actions .app-btn {
  display: grid;
  place-items: center;
  min-height: 44px;
  min-width: 0;
  padding: 5px 2cqw;
  font-size: max(.75rem, 3.65cqw);
}
.nearby-route { gap: 3cqw; }
.nearby-route-time { color: var(--dim); font-size: max(.8rem, 3.8cqw); }
.nearby-route-time strong { color: var(--ink); font-size: 1.28em; }
.nearby-empty { justify-items: start; }
.nearby-empty p { color: var(--dim); font-size: max(.73rem, 3.55cqw); }

.nearby-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 4.6cqw;
  background: var(--card);
  list-style: none;
}
.nearby-list li + li { border-top: 1px solid var(--line); }
.nearby-list button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 2.5cqw;
  width: 100%;
  min-height: 50px;
  min-width: 0;
  padding: 1.6cqw 2.7cqw;
  border: 0;
  border-radius: 3cqw;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 690;
  text-align: start;
}
.nearby-list button:hover, .nearby-list button[aria-pressed="true"] { background: var(--quiet); }
.nearby-list-copy { min-width: 0; overflow-wrap: anywhere; }
.nearby-list-copy strong { display: block; font-size: max(.82rem, 4cqw); line-height: 1.15; }
.nearby-list button small { display: block; color: var(--dim); font-size: .72rem; font-weight: 500; }
.nearby-list-distance { color: var(--dim); font-size: max(.73rem, 3.45cqw); font-variant-numeric: tabular-nums; white-space: nowrap; }
.nearby-scroll :is(button, a, input, select, [tabindex="-1"]):focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.nearby-scroll :is(.app-btn, .nearby-search button):not(.secondary):focus-visible { outline-color: var(--on-accent); }

@media (max-width: 760px) {
  .nearby-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; padding-block: 31px 40px; }
  .nearby-copy { display: contents; }
  .nearby-copy > :is(h1, .lead), .nearby-stage, .nearby-steps { grid-column: 1; }
  .nearby-page .nearby-copy .lead { margin-top: 0; }
  .nearby-stage { grid-row: 3; }
  .nearby-steps { margin-top: 4px; }
}

@media (max-width: 640px), (pointer: coarse) {
  .nearby-search input, .nearby-filters select { font-size: 16px; }
  .nearby-filters :is(button, select), .nearby-view, .nearby-actions .app-btn { min-height: 44px; }
}
