/* gestures.css (Builder 8) — swipe strips, hold press, pull to refresh, swipe back, the popover menu at the pointer.
   Theme tokens only (API.md § Theme). Motion: only transform / opacity move; the finger drives them (js/gestures.js). */
:root, :root[data-theme="light"] { --g-on: var(--on-bad); }
:root[data-theme="dark"] { --g-on: var(--ink); }

/* rows that swipe: the browser keeps vertical scrolling and pinch, the sideways move is ours */
[data-swipe], #cal-month, #cal-week { touch-action: pan-y pinch-zoom; }
@media (hover: none) {
  [data-swipe], [data-hold] { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
  [data-swipe] input, [data-swipe] textarea, [data-hold] input, [data-hold] textarea { -webkit-user-select: text; user-select: text; }
  [data-swipe] a, [data-swipe] img, [data-hold] a, [data-hold] img, a[data-swipe], a[data-hold] { -webkit-user-drag: none; }   /* a hold is the menu, not a link drag */
}
@media (max-width: 899px) { .b5-jc[data-swipe] { -webkit-user-drag: none; } }   /* the phone board: hold = the menu, not a drag */
.g-swiping { will-change: transform; }

/* touch and hold: a slow, honest squeeze while the time runs (linear); a fast let-go */
.g-press { transform: scale(.975); transition: transform .39s linear; }
.g-unpress { transition: transform .14s ease-out; }
html.mo-off .g-press, html.mo-reduced .g-press { transform: none; filter: brightness(.97); transition: none; }

/* the strip in the space the row leaves */
.g-under { position: fixed; z-index: 1; pointer-events: none; overflow: hidden; }
.g-strip { position: absolute; top: 0; bottom: 0; display: flex; align-items: center; gap: 8px; padding: 0 18px; min-width: 0;
  overflow: hidden; white-space: nowrap; font-weight: 800; font-size: 13.5px; letter-spacing: .01em;
  color: var(--g-fg, var(--muted)); background: var(--g-bg, transparent); transition: background-color .16s ease, color .16s ease; }
.g-strip.l { left: 0; justify-content: flex-start; }
.g-strip.r { right: 0; justify-content: flex-end; flex-direction: row-reverse; }
.g-strip .ic { width: 24px; height: 24px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.g-ok { --g-bg: var(--ok-bg); --g-fg: var(--ok); }
.g-info { --g-bg: var(--info-bg); --g-fg: var(--info); }
.g-warn { --g-bg: var(--warn-bg); --g-fg: var(--warn); }
.g-ok.on { --g-bg: var(--ok-dot); --g-fg: var(--g-on); }
.g-info.on { --g-bg: var(--info-dot); --g-fg: var(--g-on); }
.g-warn.on { --g-bg: var(--warn-dot); --g-fg: var(--g-on); }
/* the inbox tray (iPhone Mail): solid buttons in the space the row leaves; past the long-swipe line the last one fills it */
:root, :root[data-theme="light"] { --g-mute: #8e8e93; }
:root[data-theme="dark"] { --g-mute: #636366; }
.g-tray { position: absolute; top: 0; bottom: 0; right: 0; display: flex; overflow: hidden; }
.g-tb { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; margin: 0; padding: 0 4px; border: 0; border-radius: 0;
  font: inherit; font-size: 12px; font-weight: 700; letter-spacing: .01em; white-space: nowrap; overflow: hidden; color: var(--g-on); background: var(--g-tb);
  transition: flex-grow .22s cubic-bezier(.23, 1, .32, 1); -webkit-tap-highlight-color: transparent; }
.g-tb .ic { width: 22px; height: 22px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.g-tb span { opacity: var(--g-lab, 1); }
.g-tb.g-mute { --g-tb: var(--g-mute); } .g-tb.g-warn { --g-tb: var(--warn-dot); } .g-tb.g-ok { --g-tb: var(--ok-dot); } .g-tb.g-bad { --g-tb: var(--bad-dot); } .g-tb.g-info { --g-tb: var(--info-dot); }
.g-tray.full .g-tb:not(:last-child) { flex-grow: .0001; }
.g-tb.g-mute { color: #fff; } .g-tb.g-mute .ic { stroke-width: 3.4; }   /* iPhone: white on the grey in both themes; the three dots need weight to read */
.g-under.open .g-tb { pointer-events: auto; }
.g-under.open .g-tb:active { filter: brightness(.9); }
html.mo-off .g-tb, html.mo-reduced .g-tb { transition: none; }

/* pull to refresh: the little ring under the top bar */
.g-ptr { position: fixed; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 58px); z-index: 45; width: 40px; height: 40px; margin-left: -20px;
  border-radius: 50%; display: grid; place-items: center; pointer-events: none; opacity: 0;
  background: var(--glass-solid); color: var(--accent); border: 1px solid var(--line); box-shadow: var(--hi), var(--shadow-pop); }
.g-ptr .ic { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.g-ptr.armed, .g-ptr.busy { background: var(--orange); color: var(--ink); border-color: transparent; }
.g-ptr.done { background: var(--ok-dot); color: var(--g-on); border-color: transparent; }
.g-ptr.busy .ic { animation: g-spin .8s linear infinite; }
@keyframes g-spin { to { transform: rotate(360deg); } }
html.mo-off .g-ptr.busy .ic { animation: none; }

/* swipe back: the page lifts off the list */
main.screen.g-backing { box-shadow: var(--shadow-pop); will-change: transform; }

/* the computer: a hold / right-click menu is a small popover at the pointer, no dimmed backdrop */
@media (min-width: 900px) {
  .scrim.m.at { padding: 0; display: block; background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .scrim.m.at > .sheet.menu-s { position: fixed; left: var(--gx, 40%); top: var(--gy, 20%); width: 300px; max-height: min(74vh, 640px); padding: 10px; }
  .scrim.m.at .menu .sheet-h h2 { font-size: 15px; }
  .scrim.m.at .mi { min-height: 40px; }
}
