/* ════════════════════════════════════════════════════════════════════════════════════════════════════
   sheet.css — phone lane "sheet" (docs/design/phone/SPEC.md items 1–4). Pairs with sheet.js.
   LOAD LAST (after journey.css). Everything is inside @media (max-width:760px) and keyed on body.vgsh,
   which only sheet.js sets — so without the JS nothing here applies and Evan's/lead phone rules stand.
   · the report (#panel) is a bottom SHEET over the map: peek (tabs) · rest 60% · full 88%, drag handle on top
   · Geo's panel (#geop) is the default sheet when no report is open: peek (header + composer) · rest 52% · full 88%
   · the map fills the screen underneath; sheet.js pads the camera so it always centres in the strip you can see
   Tokens: --vg-* only; works in dark (default) and light (<html data-theme="light">).
   Heights come from sheet.js as custom properties (inline, so Evan's style resets never touch them):
     #panel / #geop  --vgsh-h   the sheet's current height (px)
     body            --vgsh-map how much of the screen bottom the resting sheet covers (px) — floats map chrome above it
   SUPERSEDES (phones only; see sheet.md for the list with line numbers):
     lead-fixes.css "Phones:" #panel.open full-screen (top/bottom/left/right/width/height/radius/border/z) + winbar safe-area pad
     door-panels.css @720 #panel radius / #panel.full radius;  Evan @720 #panel height:86vh + translateY(105%)
     Evan @760 body.geo #geop height:48vh(!important) + body.geo #map bottom:48vh; #dock / #aud bottom:calc(48vh + …)
     door.css @760 #geop radius (kept, restated);  journey.css @760 .jhome (kept — still shown)
   ════════════════════════════════════════════════════════════════════════════════════════════════════ */

@media (max-width:760px){

  /* ── the map: whole screen, under both sheets (camera padding keeps it centred in the visible strip) ── */
  html body.door.geo.vgsh #map{top:0!important;left:0!important;right:0!important;bottom:0!important}
  /* map chrome floats just above whichever sheet is resting */
  html body.door.geo.vgsh :is(.maplibregl-ctrl-bottom-right,.maplibregl-ctrl-bottom-left){bottom:var(--vgsh-map,0px);
    transition:bottom .28s cubic-bezier(.2,.8,.2,1)}
  html body.door.geo.vgsh #dock{bottom:calc(var(--vgsh-map,0px) + 8px)!important;transition:bottom .28s cubic-bezier(.2,.8,.2,1)}
  /* a sheet pulled up to ~88% leaves a thin strip: the zoom / (i) controls step aside instead of piling onto the top buttons */
  html body.door.geo.vgsh.vgsh-up :is(.maplibregl-ctrl-bottom-right,.maplibregl-ctrl-bottom-left,#dock:not(:has(#gavail.on,#avbar:not([hidden]))))
    {opacity:0;pointer-events:none!important}   /* phonemap's pinned-top For sale / listings strip stays */
  html body.door.geo.vgsh.rngopen #aud{bottom:calc(var(--vgsh-map,0px) + 72px)!important}

  /* ── the grip: a 40×4 pill in a 64×24 touch target at the top edge of each sheet ───────────────────── */
  body.door .vgsh-grip{display:none}
  html body.door.vgsh .vgsh-grip{display:block;position:absolute;z-index:20;top:0;left:50%;width:64px;height:24px;margin:0 0 0 -32px;
    padding:0;border:0;border-radius:var(--vg-pill);background:none;cursor:grab;touch-action:none;-webkit-tap-highlight-color:transparent}
  html body.door.vgsh .vgsh-grip::before{content:"";position:absolute;left:12px;right:12px;top:8px;height:4px;border-radius:var(--vg-pill);
    background:color-mix(in srgb,var(--vg-ink) 28%,transparent);transition:background .15s,transform .2s var(--vg-spring)}
  html body.door.vgsh .vgsh-grip:hover::before,html body.door.vgsh .vgsh-grip:active::before{background:color-mix(in srgb,var(--vg-ink) 50%,transparent)}
  html body.door.vgsh.vgsh-dragging .vgsh-grip::before{transform:scaleX(1.25);background:color-mix(in srgb,var(--vg-ink) 50%,transparent)}
  /* keyboard focus: the protected Vista-colours ring */
  html body.door.vgsh .vgsh-grip:focus-visible{outline:none}
  html body.door.vgsh .vgsh-grip:focus-visible::before{height:6px;top:7px;background:conic-gradient(from var(--vg-ang),var(--vg-gold),var(--vg-red),var(--vg-blue),var(--vg-gold))}

  /* ── the REPORT sheet ───────────────────────────────────────────────────────────────────────────────── */
  html body.door.vgsh #panel.open,html body.door.vgsh #panel.open.full{
    top:auto!important;bottom:0!important;left:0!important;right:0!important;width:100%!important;max-width:none!important;min-width:0!important;
    height:var(--vgsh-h,60dvh)!important;max-height:100dvh!important;transform:none!important;
    border-radius:var(--vg-r-lg) var(--vg-r-lg) 0 0!important;border:0!important;border-top:1px solid var(--vg-rule)!important;
    box-shadow:0 -8px 32px rgba(0,0,0,.28)!important;z-index:14;
    padding-top:8px!important;box-sizing:border-box;overflow:hidden;
    transition:height .28s cubic-bezier(.2,.8,.2,1)}
  :root[data-theme="light"] body.door.vgsh #panel.open{box-shadow:0 -8px 32px rgba(20,25,28,.16)!important}
  html body.door.vgsh.vgsh-dragging #panel.open{transition:none}
  html body.door.vgsh #panel .rz{display:none!important}                                /* desktop resize edges */
  html body.door.vgsh #panel .winbar .wbtn[title="Full screen"]{display:none!important} /* the grip does this now */
  /* top row: back · home · title · close — a drag surface too (buttons excepted) */
  html body.door.vgsh #panel.open .winbar{min-height:48px;border-bottom:0;padding:0 8px 0 8px!important;gap:4px;touch-action:none;cursor:grab}
  html body.door.vgsh #panel.open .winbar :is(button,a){cursor:pointer}
  html body.door.vgsh #panel.open .winbar .t{flex:1 1 auto;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  html body.door.vgsh #panel.open .winbar :is(.wbtn,.backbtn,.jhome){width:40px!important;height:40px!important}   /* ≥40 on touch */
  /* the tabs ride at the top of the sheet, right under the title — above the photo, so a peek shows title + tabs */
  html body.door.vgsh #panel.open .winwrap{display:flex;flex-direction:column}
  html body.door.vgsh #panel.open .winwrap>*{flex:none;min-width:0}
  html body.door.vgsh #panel.open .winwrap>.wnav{order:-1;top:0;margin:0;padding:0 16px 8px}
  html body.door.vgsh #panel.open .winscroll{overscroll-behavior:contain}
  /* peek: only the rows that fit show; nothing inside scrolls under your thumb */
  html body.door.vgsh #panel.open[data-vgsh="peek"] .winscroll{overflow:hidden}

  /* ── GEO's sheet (default when no report is open) ─────────────────────────────────────────────────── */
  html body.door.geo.vgsh:not(.gcollapsed) #geop{top:auto!important;bottom:0!important;left:0!important;right:0!important;width:100%!important;
    height:var(--vgsh-h,52dvh)!important;max-height:100dvh!important;padding-top:16px;box-sizing:border-box;
    border-radius:var(--vg-r-lg) var(--vg-r-lg) 0 0;border-top:1px solid var(--vg-rule);box-shadow:0 -8px 32px rgba(0,0,0,.24);
    transition:height .28s cubic-bezier(.2,.8,.2,1),transform .28s cubic-bezier(.2,.8,.2,1)}
  :root[data-theme="light"] body.door.geo.vgsh:not(.gcollapsed) #geop{box-shadow:0 -8px 32px rgba(20,25,28,.12)}
  html body.door.geo.vgsh.vgsh-dragging #geop{transition:none}
  /* the composer never scrolls or squeezes away; the thread takes what's left (0 at peek) */
  html body.door.geo.vgsh #geop>:is(.dh,.gph,.gcomp,#gcomp){flex:none}
  html body.door.geo.vgsh #geop>.gthr{flex:1 1 0;min-height:0}
  html body.door.geo.vgsh #geop[data-vgsh="peek"]>:is(.gctx,.gthr,.dnotes){display:none!important}
  /* header: a drag surface; the title reads in full ("New question", not "New q…") */
  html body.door.geo.vgsh #geop>:is(.dh,.gph){touch-action:none;min-height:48px;padding-top:0;padding-bottom:4px}
  html body.door.geo.vgsh #geop .dh .dtitle{flex:1 1 auto;min-width:64px}
  html body.door.geo.vgsh #geop .dh .dhide{display:none!important}   /* "hide the panel" = drag the grip down; frees 40px */
  html body.door.geo.vgsh #geop .dh{gap:4px;padding-left:8px;padding-right:8px}
  /* while a report sheet is up, Geo's sheet steps aside so a peeked report leaves the map clear */
  html body.door.geo.vgsh.panel-open #geop{transform:translateY(100%);visibility:hidden;
    transition:transform .28s cubic-bezier(.2,.8,.2,1),visibility 0s .28s}

  /* the spot you tapped: a pin that stays while its report is open (Arrive once, then Rest) */
  .vgsh-pin{width:18px;height:18px;border-radius:50%;background:var(--vg-red);border:3px solid #fff;box-sizing:border-box;
    box-shadow:0 0 0 2px var(--vg-gold),0 2px 8px rgba(0,0,0,.45);pointer-events:none;animation:vgsh-pin .36s var(--vg-spring) both}
  @keyframes vgsh-pin{from{opacity:0;scale:.2}to{opacity:1;scale:1}}
}

@media (prefers-reduced-motion:reduce){
  html body.door.vgsh :is(#panel.open,#geop,#dock,.maplibregl-ctrl-bottom-right,.maplibregl-ctrl-bottom-left){transition:none!important}
  html body.door.vgsh .vgsh-grip::before{transition:none!important}
  .vgsh-pin{animation:none}
}
