/* Main map: businesses in Explore, people and conversation in Chat. */
.stack { pointer-events: none; }
.stack > .round { pointer-events: auto; }
.stack .paid-control, .stack .around-control {
  box-sizing: border-box; align-content: center; gap: 0;
  font-size: 10px; line-height: 12px; text-decoration: none;
}

.home-map-card {
  --card-space: calc(100% - var(--site-header-height, 0px));
  box-sizing: border-box; position: fixed; inset: auto auto 14px 14px; margin: 0;
  width: min(360px, calc(100vw - 28px)); max-height: calc(var(--card-space) - 28px); padding: 16px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text);
  box-shadow: 0 5px 22px var(--shadow); font: 14px/1.4 system-ui, sans-serif;
}
.home-map-card[open] { display: flex; flex-direction: column; gap: 10px; }
.home-map-card::backdrop { background: rgb(15 23 42 / 13%); }
.home-map-card > header, #around-dialog footer, .around-radii { display: flex; align-items: center; gap: 8px; }
.home-map-card > header, #around-dialog footer { justify-content: space-between; }
.home-map-card h2 { margin: 0; font-size: 19px; }
.map-card-close, #around-dialog :where(#around-clear, .around-radii button) { cursor: pointer; font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
#paid-features-dialog section { border-top: 1px solid var(--line); padding-top: 8px; }
#paid-features-dialog h3, #paid-features-dialog p { margin: 0; }
#paid-features-dialog h3 { font-size: 16px; }
#paid-features-dialog a { display: inline-flex; align-items: center; min-height: 36px; color: var(--accent); text-underline-offset: 3px; }
#paid-features-dialog p { color: var(--muted); }
#open-walk-bike-tours, #walk-bike-tours .tour-back {
  display: flex; align-items: center; min-height: 44px; border: 0; background: transparent;
  color: var(--accent); cursor: pointer; font: inherit;
}
#open-walk-bike-tours { width: 100%; justify-content: space-between; padding: 0; }
#open-walk-bike-tours span { font-size: 24px; }
#walk-bike-tours {
  inset: auto 0 0 auto; width: min(360px, calc(100% - 12px)); height: var(--card-space);
  max-height: 100%; border-radius: 14px 0 0 14px; overflow-y: auto; overscroll-behavior: contain;
}
#walk-bike-tours ul { margin: 0; padding: 0; list-style: none; }
#walk-bike-tours a {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px;
  border-top: 1px solid var(--line); color: var(--accent); font-weight: 650; text-underline-offset: 3px;
}
#walk-bike-tours small { color: var(--muted); font-weight: 500; }
@media (prefers-reduced-motion: no-preference) {
  #walk-bike-tours[open] { animation: open-tour-drawer 180ms ease-out; }
  @keyframes open-tour-drawer { from { transform: translateX(100%); } to { transform: translateX(0); } }
}
.around-views { display: flex; gap: 14px; border-bottom: 1px solid var(--line); }
.around-views button { min-height: 40px; padding: 4px 8px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--muted); font: inherit; cursor: pointer; }
.around-views button[aria-selected="true"] { border-bottom-color: var(--accent); color: var(--text); font-weight: 650; }
#around-business-view:not([hidden]) { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
#around-chat-view { overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
#around-chat-status:empty { display: none; }
.home-map-card .map-card-close { width: 42px; height: 42px; font-size: 23px; }
#around-dialog fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
#around-dialog legend { padding: 0 0 6px; }
.around-radii button { flex: 1; min-height: 44px; }
#around-dialog .around-radii button[aria-pressed="true"] { background: var(--accent); color: var(--finish-on-accent); border-color: var(--accent); }
#around-status { margin: 0; font-size: 13px; }
#around-results { min-height: 0; max-height: 46vh; overflow-y: auto; overscroll-behavior: contain; }
#around-results:empty { display: none; }
#around-results details { border-top: 1px solid var(--line); }
#around-results summary { padding: 10px 0; cursor: pointer; font-weight: 650; }
#around-results ul { list-style: none; margin: 0; padding: 0 0 6px 14px; }
#around-results li { padding-block: 5px; overflow-wrap: anywhere; }
#around-results small { display: block; color: var(--muted); }
#around-dialog a { color: var(--accent); }
#around-dialog footer { font-size: 12px; }
#around-clear { padding: 7px 10px; white-space: nowrap; }
.home-map-card :focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
@media (max-width: 640px) {
  .home-map-card { inset: auto 8px 8px; width: auto; max-height: min(65%, calc(var(--card-space) - 16px)); padding: 12px; }
  #around-dialog:has(#around-chat-view:not([hidden])) { max-height: calc(var(--card-space) - 16px); }
}
@media (max-height: 440px) {
  .home-map-card { max-height: calc(var(--card-space) - 16px); overflow-y: auto; }
  #around-results { flex: none; max-height: 35vh; }
}
.neighborhood-businesses { margin-top: 14px; border-block: 1px solid var(--line); }
.neighborhood-businesses > summary {
  display: flex; align-items: center; gap: 8px; padding: 12px 0;
  list-style: none; cursor: pointer; font-size: 14px; font-weight: 650;
}
.neighborhood-businesses > summary::-webkit-details-marker { display: none; }
.neighborhood-businesses > summary::before { content: '\25B8'; width: 12px; }
.neighborhood-businesses[open] > summary::before { content: '\25BE'; }
.neighborhood-businesses .place-list { border: 0; margin: 0 0 12px; padding: 0; }
.neighborhood-businesses .place-list summary { padding: 9px 0; }
/* Only the open fold's own arrow turns, not its closed descendants. */
.neighborhood-businesses .place-list details > summary::before { content: '\25B8'; }
.neighborhood-businesses .place-list details[open] > summary::before { content: '\25BE'; }
.neighborhood-businesses .place-row { padding-block: 8px; }
.neighborhood-businesses .place-name { white-space: normal; overflow-wrap: anywhere; }

#chat-map-status,#chat-circles-status{font-size:12px;line-height:1.5;color:var(--muted)}
#chat-map-status:empty,#chat-circles-status:empty{display:none}
.chat-circle-popup{max-width:min(300px,calc(100vw - 28px))!important}
.chat-circle-popup .maplibregl-popup-content{padding:14px;border-radius:10px;background:var(--surface);color:var(--text)}
.chat-circle-popup .maplibregl-popup-close-button{width:40px;height:40px;top:2px;right:3px;font-size:20px}
.chat-circle-popup strong{display:block;padding-right:30px;font-size:15px;overflow-wrap:anywhere}
.chat-circle-popup p{font-size:12px;line-height:1.5;margin:10px 0;overflow-wrap:anywhere}
.chat-circle-popup a{color:var(--accent);font-size:13px;font-weight:650}

#around-chat-view:not([hidden]) { display: grid; gap: 10px; }
#around-chat-view .chat-ranges { gap: 5px; }
.chat-ranges button { min-width: 0; padding: 5px 2px; font-weight: 650; }
.chat-ranges small { display: block; font-size: 12px; font-variant-numeric: tabular-nums; }
.nearby-hint, #around-chat-status, #nearby-save-status { margin: 0; font-size: 12px; color: var(--muted); }
.nearby-identity, .nearby-options { display: grid; gap: 5px; }
.nearby-identity { padding-top: 10px; border-top: 1px solid var(--line); }
.nearby-identity small, #nearby-people small, #nearby-lines small { display: block; color: var(--muted); font-size: 12px; }
.nearby-options label { display: flex; gap: 8px; align-items: center; min-height: 32px; }
.nearby-options select, #nearby-text, .nearby-actions button, #nearby-show-map, #nearby-send { font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; }
.nearby-options select { min-width: 0; max-width: 100%; }
.nearby-actions { display: flex; gap: 8px; }
.nearby-actions button, #nearby-send, #nearby-show-map { min-height: 38px; cursor: pointer; }
#nearby-join, #nearby-send { background: var(--accent); color: var(--finish-on-accent); }
#nearby-join:disabled, #nearby-send:disabled { opacity: .6; cursor: default; }
#nearby-roster, #nearby-circles { border-top: 1px solid var(--line); }
#nearby-roster summary, #nearby-circles summary { cursor: pointer; padding: 8px 0; }
#nearby-people, #nearby-lines { margin: 0; padding: 0; list-style: none; max-height: 180px; overflow-y: auto; overflow-wrap: anywhere; }
#nearby-people li, #nearby-lines li { padding-block: 4px; }
#nearby-lines span { display: block; white-space: pre-wrap; }
#nearby-lines:empty, #nearby-save-status:empty { display: none; }
#nearby-compose div { display: flex; gap: 8px; }
#nearby-text { min-width: 0; flex: 1; }
.nearby-message-label { display: block; margin-bottom: 4px; }
.nearby-name-actions { display: flex; gap: 12px; }
.nearby-name-actions button { min-height: 32px; padding: 0 2px; border: 0; background: transparent; color: var(--accent); font: inherit; text-decoration: underline; cursor: pointer; }
