/* Map page (places.html). The map is the page; everything else floats over it (Airbnb, Google Maps). */
body:has(.places-page) { height: 100dvh; overflow: hidden; }
body:has(> .nav) > main.places-page { max-width: none; margin: 0; padding: 0; width: 100%; }
.places-page { position: relative; height: 100dvh; overflow: hidden; flex: none; }
.places-page ~ .site-foot { display: none; }
.pl-map { position: absolute; inset: 0; }

/* Floating controls share one surface: card fill, no border, a soft lift off the map. */
.pl-search, .pl-cat, .pl-panel, .pl-show, .pl-near {
  background: var(--card); color: var(--text); box-shadow: 0 2px 12px rgba(0,0,0,.16), 0 0 0 1px var(--line-soft); }

.pl-top { position: absolute; top: 16px; left: 16px; right: 64px; z-index: 3; display: flex; gap: 8px;
  align-items: center; overflow-x: auto; scrollbar-width: none; padding: 2px; pointer-events: none; }
.pl-top::-webkit-scrollbar { display: none; }
/* The kinds run off the right edge: fade it so the cut reads as "scroll for more". */
@media (min-width: 561px) {
  .pl-top { padding-right: 40px; -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent);
                                         mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); }
}
.pl-top > * { pointer-events: auto; }
.pl-search { flex: 0 0 360px; display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 16px; border-radius: 999px; }
.pl-search svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--dim); stroke-width: 2; stroke-linecap: round; }
.pl-search input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 15px; outline: none; }
.pl-search:focus-within { box-shadow: 0 2px 12px rgba(0,0,0,.16), 0 0 0 2px var(--focus); }
.pl-cats { display: flex; gap: 8px; flex: none; }
.pl-cat { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border: 0; border-radius: 999px;
  font: inherit; font-size: 14px; font-weight: 500; white-space: nowrap; cursor: pointer; }
.pl-cat[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.pl-cat:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.pl-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; box-shadow: 0 0 0 2px var(--card); }
.pl-cat[aria-pressed="true"] .pl-dot { box-shadow: 0 0 0 2px var(--text); }

.places-page { --pl-panel-w: 380px; }
/* Centred on the map the list leaves showing, so the list never covers it. */
.pl-zoom-hint { position: absolute; top: 76px; left: calc(50% + (var(--pl-panel-w) + 16px) / 2); transform: translateX(-50%); z-index: 2; padding: 9px 16px;
  border-radius: 999px; background: var(--text); color: var(--bg); font-size: 14px; font-weight: 500; white-space: nowrap; }
/* Address search status, under the zoom hint so the two never overlap. */
.pl-note { top: 124px; max-width: calc(100% - 32px); overflow: hidden; text-overflow: ellipsis; }
.pl-note.is-error { background: var(--card); color: var(--red); box-shadow: 0 2px 12px rgba(0,0,0,.16); }

/* Zoom sits bottom-right, stacked over Near Me (owner, 2026-10-25), clear of the search bar and the kind chips. */
.pl-map .maplibregl-ctrl-bottom-right .maplibregl-ctrl-group { margin: 0 16px 54px 0; }

/* The places in view: a panel on the left that can be put away. */
.pl-panel { position: absolute; z-index: 2; top: 76px; left: 16px; bottom: 16px; width: 380px; border-radius: 16px;
  display: flex; flex-direction: column; overflow: hidden; }
.places-page.list-hidden .pl-panel { display: none; }
.places-page.list-hidden { --pl-panel-w: -16px; }
.pl-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%;
  min-height: 52px; padding: 0 16px; border: 0; border-bottom: 1px solid var(--line-soft); background: transparent;
  color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.pl-grip { display: none; }
.pl-count { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pl-toggle-label { font-size: 13.5px; color: var(--dim); white-space: nowrap; }
.pl-panel-head:hover .pl-toggle-label { color: var(--text); }
.pl-panel-head:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.pl-list { list-style: none; margin: 0; padding: 6px; overflow-y: auto; flex: 1; min-height: 0; }
.pl-row { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 12px; align-items: start; width: 100%;
  padding: 12px 10px; border: 0; border-radius: 12px; background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.pl-row:hover, .pl-row:focus-visible, .pl-row.is-on { background: var(--raised-2); outline: none; }
.pl-row .pl-dot { margin-top: 6px; }
.pl-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pl-main b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-meta { font-size: 13px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-am { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.pl-am span { font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--raised-2); color: var(--text); }
.pl-row:hover .pl-am span, .pl-row.is-on .pl-am span { background: var(--card); }
.pl-hours { font-size: 12.5px; color: var(--green); white-space: nowrap; }
.pl-show, .pl-near { position: absolute; z-index: 2; display: inline-flex; align-items: center; gap: 8px; height: 40px;
  padding: 0 16px; border: 0; border-radius: 999px; font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; }
.pl-show { top: 76px; left: 16px; }
.pl-near { right: 16px; bottom: 36px; }
.pl-show svg, .pl-near svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.pl-show:focus-visible, .pl-near:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* The place card (MapLibre popup), Airbnb-style: a floating card, no tip. */
.maplibregl-popup-content { background: var(--card); color: var(--text); border-radius: 16px; padding: 16px 18px 18px;
  box-shadow: 0 10px 32px rgba(0,0,0,.28); }
.maplibregl-popup-tip { display: none; }
.maplibregl-popup-close-button { color: var(--dim); font-size: 20px; width: 32px; height: 32px; border-radius: 50%; top: 6px; right: 6px; }
.maplibregl-popup-close-button:hover { background: var(--raised-2); color: var(--text); }
.pl-card { display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; min-width: 240px; }
.pl-card b { font-size: 16px; font-weight: 600; padding-right: 26px; }
.pl-phone { display: flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.pl-copy { border: 1px solid var(--line); background: transparent; color: var(--text); border-radius: 999px; font: inherit; font-size: 12px; padding: 2px 10px; cursor: pointer; }
.pl-go { margin-top: 10px; align-self: flex-start; }

@media (max-width: 1023px) and (min-width: 561px) {
  .places-page { --pl-panel-w: 320px; }
  .pl-panel { width: var(--pl-panel-w); }
  .pl-search { flex-basis: 260px; }
}

/* Phones: the map behind everything, the list as a sheet over the tab bar (collapsed by default). */
@media (max-width: 560px) {
  .places-page { height: calc(100dvh - 64px); }
  .pl-top { top: 12px; left: 12px; right: 12px; flex-wrap: wrap; overflow: visible; }
  .pl-search { flex: 1 0 100%; }
  /* The kinds scroll sideways; the faded right edge says there are more. */
  .pl-cats { flex: 1 0 100%; overflow-x: auto; scrollbar-width: none; padding: 2px 32px 2px 2px; margin: -2px;
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent);
            mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); }
  .pl-cats::-webkit-scrollbar { display: none; }
  /* No floating zoom hint on a phone: it landed on the kinds. The sheet's own line says "Zoom in to list places". */
  #pl-zoom-hint { display: none; }
  .pl-note { top: 116px; }
  .pl-map .maplibregl-ctrl-bottom-right .maplibregl-ctrl-group { margin-bottom: 94px; margin-right: 12px; }
  .places-page.sheet-open .pl-map .maplibregl-ctrl-bottom-right .maplibregl-ctrl-group { display: none; }
  .pl-panel { top: auto; left: 0; right: 0; bottom: 0; width: auto; height: 62px; border-radius: 18px 18px 0 0; transition: height .22s ease; }
  .places-page.sheet-open .pl-panel { height: 64%; }
  .places-page.list-hidden .pl-panel { display: flex; }
  .pl-panel-head { flex-wrap: wrap; justify-content: space-between; min-height: 62px; padding: 8px 18px 10px; border-bottom-color: transparent; }
  .places-page.sheet-open .pl-panel-head { border-bottom-color: var(--line-soft); }
  .pl-grip { display: block; flex: 1 0 100%; height: 4px; margin: 0 auto 6px; max-width: 40px; border-radius: 2px; background: var(--line); }
  .pl-show { display: none; }
  .pl-near { bottom: 76px; right: 12px; }
  .places-page.sheet-open .pl-near { display: none; }
}
@media (prefers-reduced-motion: reduce) { .pl-panel { transition: none; } }

/* ── Rows with a picture, the card, distance, the Pro offer ── */
.pl-row { grid-template-columns: 76px minmax(0, 1fr); gap: 14px; align-items: center; }
.pl-aerial { position: relative; display: block; overflow: hidden; flex: none; background: var(--raised-2); }
.pl-aerial img { position: absolute; max-width: none; display: block; }
.pl-aerial i { position: absolute; left: 50%; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%;
  box-shadow: 0 0 0 2.5px #fff, 0 1px 4px rgba(0,0,0,.5); }
.pl-thumb { border-radius: 12px; }
.pl-name { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.pl-name b { flex: 1; min-width: 0; }
.pl-name .pl-hours { flex: none; }
.pl-locate { display: flex; align-items: center; gap: 8px; margin: 8px 12px 0; padding: 10px 12px; border: 1px dashed var(--line);
  border-radius: 12px; background: transparent; color: var(--text); font: inherit; font-size: 13.5px; cursor: pointer; text-align: left; }
.pl-locate:hover { background: var(--raised-2); }
.pl-locate svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; }
.pl-pro { display: flex; flex-direction: column; gap: 6px; margin: 10px 12px 2px; padding: 16px; border-radius: 14px;
  background: var(--text); color: var(--bg); }
.pl-pro b { font-size: 15px; font-weight: 600; }
.pl-pro span { font-size: 13.5px; line-height: 1.45; opacity: .85; }
.pl-pro .pl-pro-price { opacity: 1; font-variant-numeric: tabular-nums; }
.pl-pro-acts { display: flex; align-items: center; gap: 12px; margin-top: 6px; opacity: 1 !important; }
.pl-pro .btn-primary { background: var(--bg); color: var(--text); }
.pl-pro-x { border: 0; background: none; color: inherit; font: inherit; font-size: 13.5px; opacity: .75; cursor: pointer; }
.maplibregl-popup-content:has(.pl-card) { padding: 0; overflow: hidden; }
.pl-card { gap: 0; min-width: 0; width: 320px; max-width: calc(100vw - 48px); }
.pl-card-pic { width: 100% !important; }
.pl-card-body { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 16px; }
.pl-card-sub { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 13px; color: var(--dim); }
.pl-card-sub span + span::before { content: "·"; margin-right: 10px; color: var(--dim); }
.pl-card-line { font-size: 13.5px; }
.pl-card-line a { color: var(--text); }
.pl-card-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.pl-card-acts .btn { min-height: 38px; padding: 0 16px; font-size: 14px; }
.maplibregl-popup-close-button { z-index: 1; background: rgba(0,0,0,.45); color: #fff; }
.maplibregl-popup-close-button:hover { background: rgba(0,0,0,.65); color: #fff; }
.pl-pro-acts .btn { width: auto; flex: none; }
.pl-pro-x { white-space: nowrap; }
@media (max-width: 560px) {
  .pl-panel-head { position: relative; flex-wrap: nowrap; padding-top: 16px; }
  .pl-grip { position: absolute; top: 8px; left: 50%; width: 40px; margin: 0 0 0 -20px; flex: none; }
}
/* Pro offer, compact (owner: "too big"): one row, text left, link and close right. */
.pl-pro { flex-direction: row; align-items: center; gap: 12px; padding: 10px 10px 10px 14px; margin: 8px 12px 2px; border-radius: 12px; }
.pl-pro-text { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; opacity: 1 !important; }
.pl-pro-text b { font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pl-pro-text span { font-size: 12.5px; opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-pro-go { flex: none; padding: 6px 12px; border-radius: 999px; background: var(--bg); color: var(--text); font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.pl-pro-x { flex: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; padding: 0; }
.pl-pro-x:hover { background: color-mix(in srgb, var(--bg) 18%, transparent); }
.pl-pro-x svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
