/* R31b · Phone bottom sheet + UI polish (one definition — replaces the three competing sheet rules that were in
   management.css / zones.css / mobile-plan.css). Loaded last. */

/* ---------- phones: Site management and Event menu share one bottom sheet ---------- */
@media(max-width:700px){
 body #sitePanel.mg-panel,body #editor,body.has-selection #editor{
  position:fixed!important;left:0!important;right:0!important;bottom:0!important;top:auto!important;
  width:auto!important;min-width:0!important;max-width:none!important;margin:0!important;transform:none!important;
  height:var(--gs-h,52dvh)!important;max-height:calc(100dvh - var(--goodies-panel-top,126px))!important;
  border-radius:22px 22px 0 0!important;padding:0 14px calc(12px + env(safe-area-inset-bottom,0px))!important;
  overflow-y:auto!important;overflow-x:hidden!important;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;
  box-sizing:border-box;z-index:30;transition:height .3s cubic-bezier(.2,.8,.2,1)!important;
  box-shadow:0 -10px 34px rgba(40,40,40,.16)!important}
 body #sitePanel.mg-panel.mg-peek{max-height:calc(100dvh - var(--goodies-panel-top,126px))!important;overflow:hidden!important}
 body.gs-dragging #sitePanel.mg-panel,body.gs-dragging #editor{transition:none!important}
 body #mgGrab{display:none!important}
 .gs-grab{position:sticky;top:0;z-index:5;display:flex;justify-content:center;align-items:center;height:28px;margin:0 -14px 4px;
  padding:0;border:0;border-radius:22px 22px 0 0;background:linear-gradient(var(--paper,#fffdf6) 70%,rgba(255,253,246,0));
  cursor:grab;touch-action:none;width:calc(100% + 28px);min-height:0;box-shadow:none}
 .gs-grab span{display:block;width:42px;height:5px;border-radius:5px;background:rgba(80,85,90,.3)}
 .gs-grab:focus-visible span{background:#e58fa6}
 body #editor .panelClose,body #sitePanel .panelClose{top:6px!important}
 /* the covers card yields to a tall sheet */
 body.gs-tall #planCapacity{opacity:0;pointer-events:none}
 /* map overlays never sit on top of the sheet */
 #stationPlanLabels,#mgLabels{z-index:7}
 /* export dialog: the three choices stay on one row */
 .exportChoices{flex-wrap:nowrap!important;gap:4px!important}
 .exportChoices button{min-width:0!important;white-space:nowrap;font-size:12.5px!important;padding-left:6px!important;padding-right:6px!important}
}
@media(min-width:701px){.gs-grab{display:none!important}}

/* ---------- covers count: text only on every screen — no card, no halo ---------- */
body #planCapacity{background:none!important;-webkit-backdrop-filter:none!important;backdrop-filter:none!important;border:0!important;box-shadow:none!important;
 border-radius:0!important;padding:0!important;text-align:right;transition:opacity .2s;text-shadow:none!important}
@media(max-width:700px){body #planCapacity{right:12px!important;top:calc(var(--goodies-panel-top,126px) + 2px)!important;max-width:min(200px,52vw)!important}}

/* ---------- focus rings: visible for keyboard users, light enough not to look like an error on tap ---------- */
:is(button,summary,[role=button]):focus:not(:focus-visible){outline:none}
button:focus-visible,summary:focus-visible,[role=button]:focus-visible,#projectInfo button:focus-visible,#projectPhoto button:focus-visible{outline:2px solid #e58fa6!important;outline-offset:2px!important}

/* ---------- touch: no 300 ms tap delay or grey flash on controls ---------- */
button,summary,[role=button],.catalog-card,.mg-row{touch-action:manipulation;-webkit-tap-highlight-color:transparent}

/* ---------- motion: panels and dialogs ease in, respecting reduced motion ---------- */
@media(prefers-reduced-motion:no-preference){
 #sitePanel:not([hidden]),#editor:not([hidden]),#guidePanel:not([hidden]),#measureCard:not([hidden]){animation:gsIn .22s cubic-bezier(.2,.8,.2,1)}
 @keyframes gsIn{from{opacity:0;translate:0 10px}to{opacity:1;translate:0 0}}
}

/* R31i · Site management tag button = show / hide all plan annotations
   (station badges, leaders, station outlines and seat counts, zone outlines and names, furniture IDs, cabana and event-item names) */
body.plan-annot-off #stationPlanLabels,body.plan-annot-off #zoneOutlines,body.plan-annot-off #mgLabels,
body.plan-annot-off #cabanaNames,body.plan-annot-off #evLabels{display:none!important}
