/* VSSGEO design team, designer 1 — "parity-map" (2026-09-28). Map app + Geo chat: phone and desktop wear the SAME
   control states, in both themes. LOAD LAST on the map page (after door/phone/*.css and after r2/account2.css).
   Pairs with parity-map.js (adds .vgp-press for ~650 ms after a finger lifts, so a tap is visible as a moving ring).

   The state language (desktop already had it; this file brings phone in line and fills the gaps on both):
     rest   no ring
     hover  ring, turning (4.5 s)             — only where a real pointer hovers (hover:hover)
     press  ring, turning (2.4 s)             — :active, and .vgp-press on touch (the finger's version of hover)
     on     ring, still (.85)                 — open / pressed / expanded
     focus  ring, turning + the accent outline — keyboard
   Ring recipe = door/door.css: ::after conic-gradient(from var(--vg-ang)) masked to a 1.4 px border, vg-spin.
   Phone-only rules sit in (max-width:720px) / (pointer:coarse) / (hover:none). Tokens only; 8-pt grid. */

/* ══ 1 · the ring on controls that never had it ═══════════════════════════════════════════════════════════════
   phone More (⋯) and Address (phonemap.js), and on every width the mic and send. Mic and send keep ::after for
   their own effects (the listening pulse, the sheen), so their ring is drawn on ::before. */
html body.door :is(.pm-more,.gcomp .pm-addr,.vg-mic,.gsend){position:relative;isolation:isolate}
html body.door :is(.pm-more,.gcomp .pm-addr)::after,
html body.door :is(.gbrow .vg-mic,.gbrow .gsend)::before{
  content:"";position:absolute;inset:0;border-radius:inherit;padding:1.4px;pointer-events:none;z-index:2;
  background:conic-gradient(from var(--vg-ang),var(--vg-gold) 0deg,var(--vg-red) 110deg,var(--vg-blue) 210deg,var(--vg-gold) 330deg,var(--vg-gold) 360deg);
  -webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);
  -webkit-mask-composite:xor;mask-composite:exclude;opacity:0;transition:opacity .22s ease}
/* hover (real pointers only) */
@media (hover:hover){
  html body.door :is(.pm-more,.gcomp .pm-addr):hover::after,
  html body.door :is(.gbrow .vg-mic,.gbrow .gsend):hover::before{opacity:1;animation:vg-spin 4.5s linear infinite}
}
/* press */
html body.door :is(.pm-more,.gcomp .pm-addr):is(:active,.vgp-press)::after,
html body.door :is(.gbrow .vg-mic,.gbrow .gsend):is(:active,.vgp-press)::before{opacity:1;animation:vg-spin 2.4s linear infinite}
/* focus: ring + the same accent outline the tool chest uses (the mic had the browser's white default) */
html body.door :is(.pm-more,.gcomp .pm-addr):focus-visible::after,
html body.door :is(.gbrow .vg-mic,.gbrow .gsend):focus-visible::before{opacity:1;animation:vg-spin 4.5s linear infinite}
html body.door .gbrow .vg-mic:focus-visible{outline:2px solid var(--vg-accent);outline-offset:2px}
/* on: More open / Address mode — a still ring, like the open tool chest. The listening mic keeps its red pulse only. */
html body.door .pm-more:is(.on,[aria-expanded="true"])::after,html body.door .gcomp .pm-addr.on::after{opacity:.85;animation:none}
html body.door .pm-more:is(.on,[aria-expanded="true"]):is(:focus-visible,:active,.vgp-press)::after{opacity:1;animation:vg-spin 4.5s linear infinite}
html body.door .gbrow .vg-mic.vg-mic-on::before{opacity:0!important;animation:none!important}
/* More "on" gets the chest's "on" surface too (it only changed its icon colour) */
html body.door .pm-more:is(.on,[aria-expanded="true"]){background:color-mix(in srgb,var(--vg-accent) 16%,var(--vg-panel));color:var(--vg-accent)}
/* Address sat in a grey outline next to a borderless Area: it now rests like Area (no box) and speaks in rings */
html body.door .gcomp .pm-addr{border-color:transparent}
html body.door .gcomp .pm-addr.on{background:var(--vg-accent-soft)}

/* focus on the header buttons, + and the Geo-bubble controls: the ring joins the outline (the chest already did both) */
html body.door :is(#geop .dh .dib,.gbrow .gplus,.gchips .chip):focus-visible::after{opacity:1;animation:vg-spin 4.5s linear infinite}


/* ══ 2 · touch: hover is a mouse idea. The ring answers the finger (press), then rests. ═════════════════════════
   On phones the browser keeps :hover on the last thing tapped, so the chest, +, header buttons and zoom box kept a
   spinning ring after the tap was over (and More never had one). Same fix as phonecards.css §D, for the map + chat. */
@media (hover:none){
  html body.door :is(#gmapc:not(.vg-open) .vg-chest,#gmapc .vg-tray>button:not(.on):not([aria-expanded="true"]),#geop .dh .dib,.gbrow .gplus,
    .gfoot .gel:not([aria-pressed="true"]),.gfoot .glib:not([aria-expanded="true"]),.gchips .chip,.maplibregl-ctrl-group:not(:focus-within)):hover:not(:active):not(.vgp-press):not(:focus-visible)::after{opacity:0;animation:none}
  /* the open chest keeps its still ring, it just stops turning once the finger is gone */
  html body.door #gmapc.vg-open .vg-chest:hover:not(:active):not(.vgp-press):not(:focus-visible)::after{opacity:.85;animation:none}
  html body.door #gmapc .vg-chest:hover:not(:active):not(.vgp-press){transform:none}
  /* press: every ring control turns while (and just after) the finger is down */
  html body.door :is(#gmapc .vg-chest,#gmapc .vg-tray>button,#geop .dh .dib,.gbrow .gplus,.gfoot .gel,.gfoot .glib,.gchips .chip,.maplibregl-ctrl-group):is(:active,.vgp-press)::after{opacity:1;animation:vg-spin 2.4s linear infinite}
  html body.door .maplibregl-ctrl-group:has(button:active,button.vgp-press)::after{opacity:1;animation:vg-spin 2.4s linear infinite}
  /* Area: its lasso is its ring (lead-fixes.css) — it marches on press as it does on hover */
  html body.door #gbnd.vg-bnd:is(:active,.vgp-press) .vg-bnd-lasso{animation:vg-bnd-march 1.2s linear infinite}
  html body.door #gbnd.vg-bnd:is(:active,.vgp-press) stop:nth-child(1){animation:vg-bnd-c1 2.4s linear infinite}
  html body.door #gbnd.vg-bnd:is(:active,.vgp-press) stop:nth-child(2){animation:vg-bnd-c2 2.4s linear infinite}
  html body.door #gbnd.vg-bnd:is(:active,.vgp-press) stop:nth-child(3){animation:vg-bnd-c3 2.4s linear infinite}
  html body.door #gbnd.vg-bnd:hover:not([aria-pressed="true"]):not(:active):not(.vgp-press):not(:focus-visible) :is(.vg-bnd-lasso,stop){animation:none}
  /* the sheet grip: the pill turns brand-coloured while it is held or dragged (it already did for keyboard focus) */
  html body.door.vgsh .vgsh-grip:is(:active,.vgp-press)::before,html body.door.vgsh.vgsh-dragging .vgsh-grip::before{
    background:conic-gradient(from var(--vg-ang),var(--vg-gold),var(--vg-red),var(--vg-blue),var(--vg-gold));animation:vg-spin 2.4s linear infinite}
}


/* ══ 3 · phone hit targets: 44 px (brief), was 40 for map + header + composer, 32 for "Helpful?" ═══════════════ */
@media (pointer:coarse){
  :root{--th-hit:44px;--vgmap-ctl:44px}
  html body.door #gmapc :is(.vg-chest,.vg-tray>button){width:44px;height:44px}
  html body.door .gbrow :is(.vg-mic,.gsend,.gplus){width:44px;height:44px}
  html body.door .gbrow #gbnd{height:44px}
  html body.door .gm.geo .dreact button[data-r]{width:44px;height:44px;min-width:44px!important;min-height:44px!important}   /* [!] bubbles.css pins 32 with !important */
  html body.door .gm.geo .dtrace summary{min-height:44px}
  /* ladder tiers and the story-legend bands: 44 px tall touch areas (the blocks themselves keep their size) */
  html body.door #dock #lbar>i::after{inset:-16px -1px}
  html body.door .vgs-ramp>b::after{inset:-17px -1px}
}


/* the floating map controls (zoom, More, tool chest + tray) are 44 at phone width as well, whatever the pointer */
@media (max-width:720px){
  :root{--vgmap-ctl:44px}
  html body.door #gmapc :is(.vg-chest,.vg-tray>button),html body.door .pm-more{width:44px;height:44px}
  html body.door .maplibregl-ctrl-group button{width:44px;height:44px}
}


/* ══ 4 · phone layout: overlaps, clipping, safe areas ══════════════════════════════════════════════════════════ */
@media (max-width:720px){
  /* the #1–#100 ladder / story legend ran under the map credits ("#100" behind "© OpenMapTiles"): with a legend on,
     the right-hand stack (More, zoom, credits) steps up above it */
  html body.door.geo.vgsh:is(.lseg,.heat) .maplibregl-ctrl-bottom-right{bottom:calc(var(--vgsh-map,0px) + 64px)}
  /* …and with the stack out of its way the legend may use the full width, so "#100" stays inside its pill
     (it was 334 px of content in a 294 px dock, the label hanging over the map) */
  html body.door.geo.vgsh:is(.lseg,.heat) #dock{max-width:calc(100vw - 2 * var(--vgmap-inset,16px))!important}   /* [!] Evan's --avail cap */
  html body.door.geo.vgsh.lseg #dock>#ladder{min-width:0;flex:1 1 auto}
  html body.door.geo.vgsh.lseg #dock #lbar{min-width:0}
  /* long placeholders ("Click the map to place a boundary, or ask Geo") broke onto a half-hidden second line */
  html body.door #gin::placeholder{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  /* viewport-fit=cover: keep the composer off the home indicator and the corner tools out of the status bar */
  html body.door.geo.vgsh:not(.gcollapsed) #geop{padding-bottom:env(safe-area-inset-bottom,0px)}
  html body.door.vgsh #panel.open .winscroll{padding-bottom:env(safe-area-inset-bottom,0px)}
  html body.door #gmapc{margin-top:env(safe-area-inset-top,0px)}
  html body.door.geo #dock #gavail.on,html body.door.geo #dock #avbar:not([hidden]){margin-top:env(safe-area-inset-top,0px)}
}


@media (prefers-reduced-motion:reduce){
  html body.door :is(.pm-more,.gcomp .pm-addr,#gmapc .vg-chest,#gmapc .vg-tray>button,#geop .dh .dib,.gbrow .gplus,.gfoot .gel,.gfoot .glib,.gchips .chip,.maplibregl-ctrl-group)::after,
  html body.door :is(.gbrow .vg-mic,.gbrow .gsend)::before,html body.door.vgsh .vgsh-grip::before{animation:none!important}
}
