/* Phones: a map page as a map app (2026-10-30, the owner chose C; MASTER). Used by the area page, compare, the address map and the
   neighbourhood finder, with shared/app-sheet.js. The page's template sets html.app-map before the first paint (640px or less), marks
   its map frame .app-frame and its map .app-map-el, and wraps the rest in #app-sheet. The map is fixed behind; the page is the sheet
   over it, pulled up by scrolling the page itself, so there is one scroll only. */
.app-grab { display: none; }
@media (max-width: 640px) {
  html.app-map { scroll-snap-type: y proximity; }
  html.app-map body { overscroll-behavior-y: none; }
  /* the strips and the bar float over the map instead of taking room in the page, so the sheet's place depends only on the screen
     height and the peek, not on a strip arriving late (2026-10-30, CLS) */
  html.app-map body > .ww-strip { position: fixed; top: 0; left: 0; right: 0; z-index: 1101; }
  html.app-map body > .ww-strip-hold { display: none; }
  html.app-map body:has(> .ww-strip, > .ww-strip-hold) { --app-bar-top-guess: 45px; }   /* a strip is there or on its way */
  html.app-map .topbar { position: fixed; top: var(--app-bar-top, var(--app-bar-top-guess, 0px)); left: 0; right: 0; z-index: 1100; }
  /* the map fills the whole screen from the very top, under the strips and the bar, so it never moves while they settle (2026-10-30, CLS);
     anything floating on the map starts below them: top: calc(var(--app-head) + …) */
  html.app-map .app-frame { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 0; display: flex; flex-direction: column;
    margin: 0; border: 0; border-radius: 0; }
  html.app-map .app-map-el { flex: 1 1 auto; height: auto !important; min-height: 0 !important; }
  html.app-map .leaflet-control-zoom { display: none; }   /* two fingers zoom; the buttons would sit under the sheet */
  html.app-map .app-sheet { position: relative; z-index: 1; margin-top: calc(100vh - var(--app-peek, 190px));
    margin-top: calc(100svh - var(--app-peek, 190px)); background: #fff; border-radius: 20px 20px 0 0; box-shadow: 0 -8px 24px rgba(0, 0, 0, .16); }
  /* the top bar floats over the map as one white pill, the map running up to the screen's edge behind it (2026-10-31, the owner: like
     Google Maps; sample reports/samples/mobile/WhereWise_휴대폰상권화면_최종안_v1.00.html) */
  html.app-map .topbar { padding: 8px 10px 0; background: none; border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  html.app-map.app-sheet-full .topbar { background: #fff; }   /* once the sheet is up, nothing shows through around the pill */
  html.app-map .topbar-in { flex-wrap: nowrap; padding: 4px 6px 4px 8px; background: #fff; border-radius: 28px; box-shadow: var(--ww-shadow); }   /* the pill's own inset replaces the page gutter, so the search still fits on one line at 375px */
  /* the grab: a coral chevron (⌃, flipped to ⌄ once the sheet is all the way up) and, until the sheet has been pulled up once in this
     browser, the hint beside it (data-hint, app-sheet.js) (2026-10-31, the owner) */
  html.app-map .app-grab { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 42px; padding: 0; border: 0;
    background: none; cursor: grab; font: inherit; }
  html.app-map .app-grab span { display: block; width: 10px; height: 10px; margin-top: 4px; border: solid var(--ww-here, #FF385C); border-width: 2.5px 2.5px 0 0;
    border-radius: 1px; transform: rotate(-45deg); transition: transform .2s ease-out, margin .2s ease-out; }
  html.app-map .app-grab::after { content: attr(data-hint); color: #6E6E73; font-size: 13px; font-weight: 500; }
  html.app-map.app-hint-seen .app-grab::after, html.app-map.app-sheet-full .app-grab::after { content: none; }
  html.app-map.app-sheet-full .app-grab span { margin-top: -4px; transform: rotate(135deg); }
  html.app-map .app-grab:focus-visible { outline: 2px solid #222; outline-offset: -4px; }
  /* the first visit: the sheet rises a little once and settles, so it reads as something to pull */
  html.app-map .app-sheet.app-nudge { animation: app-nudge 1.1s cubic-bezier(.3, .7, .4, 1) .5s 1; }
  @keyframes app-nudge { 35% { transform: translateY(-40px); } 70% { transform: translateY(4px); } }
  @media (prefers-reduced-motion: reduce) { html.app-map .app-sheet.app-nudge { animation: none; } }
  html.app-map .app-snap { position: absolute; left: 0; width: 1px; height: 1px; scroll-snap-align: start; pointer-events: none; }
  html.app-map .chat-tease { display: none; }   /* the greeting bubble would cover the sheet's low edge */
  html.app-map .chat-launch, html.app-map body:has(.ww-consent) .chat-launch { bottom: var(--app-launch, 16px); width: 56px; height: 56px; padding: 3px; transition: bottom .15s ease-out; }
}
