/* NEAR.me — Pulse UIX (opt-in selectable style).
 * Scoped so the DEFAULT style is completely unaffected: every rule that changes
 * layout is gated behind html[data-uix="pulse"]. The appearance overlay is the
 * only always-present addition (it's just a hidden modal until opened).
 * Tokens come from css/style.css (--accent, --surface, --text, --border, etc.).
 * Specifics (48dp Pulse, 16dp margin, 24dp dead-zone, etc.) per UI-GESTURES-RESEARCH.md.
 */

/* Z-INDEX BAND: all Pulse UI sits at z 45–145, BELOW the App overlay stack
 * (top-bar 50, drawers 150, modals 200, image 300, toasts 500, dialogs 600,
 * worklog 700, tag-popover / overlay-modal 1000). This is deliberate: App
 * drawers/modals/popovers/toasts opened from within Pulse mode must render
 * ABOVE the Pulse chrome. Do not raise these above 149. */

/* ===================== Appearance / Style selector ===================== */
.appearance-overlay { position: fixed; inset: 0; z-index: 145; display: none; }
.appearance-overlay.open { display: block; }
.appearance-backdrop { position: absolute; inset: 0; background: var(--backdrop); }
.appearance-sheet {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -46%);
  width: min(92vw, 360px);
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-heavy);
  padding: 18px;
  max-height: 86vh; overflow-y: auto;   /* four sections may exceed short screens */
  opacity: 0;
  transition: opacity .2s cubic-bezier(0.4, 0, 0.2, 1),
              transform .2s cubic-bezier(0.4, 0, 0.2, 1);
}
.appearance-overlay.open .appearance-sheet { opacity: 1; transform: translate(-50%, -50%); }
.appearance-head { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
/* Each control is its own clearly-separated section with a prominent header. */
.appearance-section { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.appearance-section:first-of-type { margin-top: 12px; padding-top: 0; border-top: none; }
.appearance-group-label {
  font-size: 13px; font-weight: 700; color: var(--text);
  text-transform: uppercase; letter-spacing: .06em;
  margin: 0 0 10px;
}
.appearance-seg { display: flex; gap: 6px; }
.appearance-group-hint { font-size: 11px; color: var(--text-dim); margin: 6px 2px 0; line-height: 1.4; }
.seg-btn {
  flex: 1; padding: 9px; font: inherit; cursor: pointer;
  border: 1px solid var(--border); background: transparent; color: var(--text-dim);
  border-radius: var(--radius);
}
.seg-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.appearance-list { display: flex; flex-direction: column; gap: 8px; }
.style-row {
  display: flex; align-items: center; gap: 10px;
  padding: 12px; font: inherit; cursor: pointer; text-align: left;
  border: 1px solid var(--border); background: transparent; color: var(--text);
  border-radius: var(--radius);
}
.style-row.active { border-color: var(--accent); background: var(--surface-2); }
/* Coming-soon placeholder row: visible but inert. */
.style-row.is-disabled { opacity: .45; cursor: default; }
.style-row.is-disabled:hover { background: transparent; border-color: var(--border); }
.style-row-main { display: flex; flex-direction: column; flex: 1; gap: 2px; }
.style-row-name { font-weight: 600; }
.style-row-desc { font-size: 12px; color: var(--text-dim); }
.style-row-check { color: var(--accent); font-weight: 700; min-width: 14px; }
.appearance-done {
  margin-top: 18px; width: 100%; padding: 11px; font: inherit; font-weight: 600;
  border: none; background: var(--accent); color: #fff;
  border-radius: var(--radius); cursor: pointer;
}
/* Build stamp — quiet freshness check at the foot of the Appearance sheet. */
.appearance-ver {
  margin-top: 10px; text-align: center;
  font-size: 11px; color: var(--text-dim); letter-spacing: .02em;
}

/* ===================== Pulse FAB ===================== */
/* Bottom-right anchor (green thumb zone), 48dp diameter, 16dp margin — facets 5/9.
 * Hidden by default; PulseUIX.enable() sets display:flex. */
.pulse-fab {
  position: fixed; z-index: 130;
  /* honor the notch / home indicator (viewport-fit=cover is set). 24px keeps the
     48px FAB body clear of Android's ~24px edge-back gesture zone so pressing /
     marking it doesn't get hijacked as a "back" swipe. */
  right: calc(24px + env(safe-area-inset-right, 0px));
  /* Straddle the promoted band's top edge: center the 48px FAB on it, so the
     lower half sits in the band and the upper half floats over the feed canvas.
     --pulse-band-h is the band's measured height (incl. its safe-area padding),
     published by PulseUIX; fallback covers the moment before it's measured. */
  bottom: calc(var(--pulse-band-h, 64px) - 24px);
  width: 48px; height: 48px; padding: 0;
  display: none; align-items: center; justify-content: center;
  border: none; border-radius: 50%; cursor: pointer;
  background: var(--accent); box-shadow: var(--shadow-heavy);
  -webkit-tap-highlight-color: transparent;
  touch-action: none;            /* we own the gesture (facet 3) */
}
/* Show only in-app (body.pulse-on set by PulseUIX when entered + style active) */
html[data-uix="pulse"] body.pulse-on .pulse-fab { display: flex; }
html[data-uix="pulse"] body.pulse-on .pulse-fab::after { animation: pulse-beacon 2.2s ease-out infinite; }
/* …but get out of the way while a drawer/overlay/modal is open. :has() is
 * progressive — if unsupported, the FAB simply stays visible (no harm). */
html[data-uix="pulse"] body.pulse-on.pulse-panel-open .pulse-fab,
html[data-uix="pulse"] body.pulse-on:has(.drawer.open) .pulse-fab,
html[data-uix="pulse"] body.pulse-on:has(.pulse-overlay.open) .pulse-fab,
html[data-uix="pulse"] body.pulse-on:has(.pulse-cmdk.open) .pulse-fab,
html[data-uix="pulse"] body.pulse-on:has(#appearance-overlay.open) .pulse-fab,
html[data-uix="pulse"] body.pulse-on:has(.modal.open) .pulse-fab { display: none; }
.pulse-fab-core {
  width: 14px; height: 14px; border-radius: 50%; background: #fff;
}
/* The beacon ripples OUTWARD from the FAB edge into the feed via a pseudo-element
 * (FAB's own drop shadow stays separate; strong accent so it's clearly visible). */
.pulse-fab::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
}
@keyframes pulse-beacon {
  0%   { box-shadow: 0 0 0 2px rgba(255, 107, 53, 0.55); }
  70%  { box-shadow: 0 0 0 20px rgba(255, 107, 53, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 107, 53, 0); }
}
/* The Pulse SPEAKS (2026-07-02): when a message whispers out of the corner,
 * the FAB beats once in the message's tone — a colored ring bursts from the
 * body and fades. UI.toast adds .fab-speak + a tone class for ~900ms. Rides
 * ::before (the ambient beacon owns ::after). */
.pulse-fab::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  pointer-events: none; opacity: 0;
}
.pulse-fab.fab-speak::before {
  border: 2px solid var(--speak-tone, var(--accent));
  animation: fab-speak-ring 0.85s ease-out;
}
.pulse-fab.fab-speak-success { --speak-tone: var(--success); }
.pulse-fab.fab-speak-error   { --speak-tone: var(--danger); }
.pulse-fab.fab-speak-info    { --speak-tone: var(--info); }
@keyframes fab-speak-ring {
  0%   { opacity: 0.9; transform: scale(1); }
  100% { opacity: 0;   transform: scale(2.1); }
}
@media (prefers-reduced-motion: reduce) {
  .pulse-fab.fab-speak::before { animation: none; }
}

.pulse-fab-badge {
  position: absolute; top: -3px; right: -3px;
  min-width: 18px; height: 18px; padding: 0 4px;
  border-radius: 9px; background: var(--surface); color: var(--text);
  border: 1px solid var(--border);
  font-size: 11px; line-height: 18px; text-align: center; font-weight: 700;
}
@media (prefers-reduced-motion: reduce) {
  .pulse-fab::after { animation: none; }
  /* static accent halo so the Pulse still stands out when motion is reduced */
  html[data-uix="pulse"] body.pulse-on .pulse-fab::after { box-shadow: 0 0 0 3px var(--accent-glow); }
}


/* Cancel state: while the finger is in the dead-zone, the Pulse shows ✕ so the
 * user knows releasing now cancels (decision #1 / WCAG 2.5.2). */
.pulse-fab-x {
  position: absolute; inset: 0; display: none;
  align-items: center; justify-content: center; color: #fff;
}
.pulse-fab-x svg { width: 22px; height: 22px; }
.pulse-fab.cancel { background: var(--text-dim); }
.pulse-fab.cancel .pulse-fab-core { opacity: 0; }
.pulse-fab.cancel .pulse-fab-x { display: flex; }

/* ===================== Radial marking menu ===================== */
.pulse-menu { position: fixed; inset: 0; z-index: 135; display: none; pointer-events: none; }
.pulse-menu.open { display: block; }

/* Spotlight scrim: a radial dim anchored at the Pulse (bottom-right). Gentlest
 * near the thumb so the feed peeks there; deepens toward the slices so they pop.
 * Visual only (pointer-events:none) — the gesture/tap-away logic is unchanged. */
.pulse-scrim {
  position: fixed; inset: 0; pointer-events: none;
  background: radial-gradient(155% 145% at bottom right,
              rgba(0, 0, 0, 0.03) 0%, rgba(0, 0, 0, 0.40) 52%, rgba(0, 0, 0, 0.55) 100%);
  opacity: 0; transition: opacity .18s ease;
}
.pulse-menu.open .pulse-scrim { opacity: 1; }
/* The Pulse reads brighter while its menu is open — steady glow, no beacon. */
html[data-uix="pulse"] body.pulse-menu-open .pulse-fab {
  box-shadow: 0 0 0 4px var(--accent-glow), 0 0 22px 2px var(--accent-glow), var(--shadow-heavy);
}
html[data-uix="pulse"] body.pulse-menu-open .pulse-fab::after { animation: none; }
@media (prefers-reduced-motion: reduce) { .pulse-scrim { transition: none; } }
/* Slice = a 48px icon positioned on the arc; the label floats to its LEFT
 * (so labels clear the neighboring icons in the up-left fan). */
.pulse-slice {
  position: fixed; width: 48px; height: 48px; padding: 0; margin: 0; z-index: 1;
  border: none; background: transparent; cursor: pointer; font: inherit;
  pointer-events: auto;
  opacity: 0; transform: scale(0.4);
  transition: opacity .15s ease, transform .16s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.pulse-slice.active { z-index: 2; }   /* highlighted slice + its label sit on top */
.pulse-menu.open .pulse-slice { opacity: 1; transform: scale(1); }
.pulse-slice-ic {
  width: 48px; height: 48px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); box-shadow: var(--shadow-soft);
  transition: background .12s ease, transform .12s ease, border-color .12s ease;
}
.pulse-slice-ic svg { width: 20px; height: 20px; }
.pulse-slice-tx {
  /* left/top set per-slice in JS (radial-outward spoke); centered on that point */
  position: absolute; left: 24px; top: 24px; transform: translate(-50%, -50%);
  white-space: nowrap; pointer-events: none;
  font-size: 12px; font-weight: 600; color: var(--text);
  background: var(--surface); border: 1px solid var(--border);
  padding: 2px 8px; border-radius: 9px; box-shadow: var(--shadow-soft);
}
.pulse-slice.active .pulse-slice-ic {
  background: var(--accent); color: #fff; border-color: var(--accent);
  transform: scale(1.12);
}
.pulse-slice.active .pulse-slice-tx { border-color: var(--accent); color: var(--accent); }

/* The inactive ring is fully hidden (Lens swap). */
.pulse-slice.hidden { display: none; }

/* Radial-mode "pull in to go back" affordance — parked on the inner pull-in
   ring while a sub-ring is open. Cue only (pointer-events:none); the collapse
   is gesture-driven (_onMoveRadial). Centered on its computed point. */
.pulse-back-hint {
  position: fixed; transform: translate(-50%, -50%) scale(0.6);
  display: flex; align-items: center; gap: 4px;
  padding: 4px 9px 4px 6px; border-radius: 14px; white-space: nowrap;
  background: var(--surface); color: var(--text-dim);
  border: 1px dashed var(--border);
  font-size: 11px; font-weight: 600; line-height: 1;
  opacity: 0; pointer-events: none; z-index: 1;
  transition: opacity .15s ease, transform .16s cubic-bezier(0.2, 0.8, 0.2, 1);
}
/* Mirror SVG.back so the arrow points INWARD toward the Pulse — the direction
   the finger travels to go back (owner/Jody feedback 2026-07-01). */
.pulse-back-hint svg { width: 14px; height: 14px; transform: scaleX(-1); }
.pulse-back-hint.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
@media (prefers-reduced-motion: reduce) { .pulse-back-hint { transition: opacity .15s ease; } }

/* Lens sub-ring: tint each category icon at rest, fill with its color on
   highlight (matches the People/Place/Thing badge palette). */
.pulse-lens-slice.cat-people .pulse-slice-ic { color: var(--info); }
.pulse-lens-slice.cat-place  .pulse-slice-ic { color: var(--success); }
.pulse-lens-slice.cat-thing  .pulse-slice-ic { color: var(--accent); }
.pulse-lens-slice.cat-people.active .pulse-slice-ic { background: var(--info);    border-color: var(--info);    color: #fff; }
.pulse-lens-slice.cat-place.active  .pulse-slice-ic { background: var(--success); border-color: var(--success); color: #fff; }
.pulse-lens-slice.cat-thing.active  .pulse-slice-ic { background: var(--accent);  border-color: var(--accent);  color: #fff; }
.pulse-lens-slice.cat-people.active .pulse-slice-tx { border-color: var(--info);    color: var(--info); }
.pulse-lens-slice.cat-place.active  .pulse-slice-tx { border-color: var(--success); color: var(--success); }
.pulse-lens-slice.cat-thing.active  .pulse-slice-tx { border-color: var(--accent);  color: var(--accent); }

/* Me sub-ring: same treatment as the Lens ring, hued to MATCH the audience
   breadcrumb chips (.lc-* in spatial.css) — Public cyan, Subscribed violet,
   Friends orange — so a flip reads the same colour on the Pulse and at the top. */
.pulse-me-slice.me-public     .pulse-slice-ic { color: #2bb3d6; }
.pulse-me-slice.me-subscribed .pulse-slice-ic { color: #9b6cff; }
.pulse-me-slice.me-links      .pulse-slice-ic { color: var(--accent); }
.pulse-me-slice.me-public.active     .pulse-slice-ic { background: #2bb3d6;      border-color: #2bb3d6;      color: #fff; }
.pulse-me-slice.me-subscribed.active .pulse-slice-ic { background: #9b6cff;      border-color: #9b6cff;      color: #fff; }
.pulse-me-slice.me-links.active      .pulse-slice-ic { background: var(--accent); border-color: var(--accent); color: #fff; }
.pulse-me-slice.me-public.active     .pulse-slice-tx { border-color: #2bb3d6;      color: #2bb3d6; }
.pulse-me-slice.me-subscribed.active .pulse-slice-tx { border-color: #9b6cff;      color: #9b6cff; }
.pulse-me-slice.me-links.active      .pulse-slice-tx { border-color: var(--accent); color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  .pulse-slice { transition: opacity .12s ease; transform: none; }
  .pulse-menu.open .pulse-slice { transform: none; }
}
/* Very narrow screens: drop slice labels (icons + aria-label remain) so the
 * 6-item fan doesn't crowd. */
@media (max-width: 360px) { .pulse-slice-tx { display: none; } }

/* ===================== Pulse mode: re-home the tools ===================== */
/* In pulse mode the TOOLS strip (.filter-bar) leaves the flow and becomes a
 * left slide-in panel the Pulse opens — reclaiming the feed's vertical space.
 * Reuses every existing control unchanged (radius slider, tag shelves, search). */
html[data-uix="pulse"] .filter-bar {
  position: fixed; right: 0; top: 0; bottom: 0;
  width: min(440px, 92vw); z-index: 150;
  margin: 0; padding: 0 16px 16px;
  /* Match the right-side drawers (Me / Inbox / Share): square-cornered slab
     flush to the edge, single left border, app-bg fill, directional shadow.
     The base .filter-bar's rounded corners + 4-side border are reset here.
     padding-top is 0 so the injected header can bleed to the panel's top edge. */
  background: var(--bg);
  border: none; border-left: 1px solid var(--border); border-radius: 0;
  box-shadow: -8px 0 30px var(--shadow-heavy);
  overflow-y: auto;
  transform: translateX(104%);
  transition: transform .22s cubic-bezier(0.4, 0, 0.2, 1);
}
html[data-uix="pulse"] body.pulse-panel-open .filter-bar { transform: translateX(0); }
@media (prefers-reduced-motion: reduce) {
  html[data-uix="pulse"] .filter-bar { transition: none; }
}
/* TAGS is the only side-panel tool: hide the (now-empty) radius/search rows so
 * the panel shows tags only. Search + radius live in center overlays. */
html[data-uix="pulse"] .filter-bar .filter-row,
html[data-uix="pulse"] .filter-bar .mkt-bar { display: none; }

/* Drawer-style header (title + ✕), mirroring the Me / Inbox / Share drawers.
   Injected by PulseUIX; the negative side margins bleed it to the panel edges
   over the panel's own 16px side padding, so its border-bottom spans full width. */
.pulse-panel-head { display: none; }
html[data-uix="pulse"] .pulse-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky; top: 0; z-index: 1;
  margin: 0 -16px 14px;
  /* clears the notch on the Pixel, matching the drawers' safe-area handling */
  padding: calc(18px + env(safe-area-inset-top)) 20px 14px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
html[data-uix="pulse"] .pulse-panel-head h2 {
  margin: 0; font-size: 1.2rem; letter-spacing: 1px;
}
/* SVG.x carries no width/height attrs (unlike the drawers' inline markup). */
#pulse-panel-close svg { width: 18px; height: 18px; }
/* In the narrow panel, tags should WRAP and stack — not scroll in one line.
 * (.chip-rail is a horizontal scroller by default; override it here only.) */
html[data-uix="pulse"] .filter-bar .followed-shelf,
html[data-uix="pulse"] .filter-bar .filtered-shelf { display: block; margin-bottom: 14px; }
html[data-uix="pulse"] .filter-bar .shelf-label { display: block; margin-bottom: 8px; }
html[data-uix="pulse"] .filter-bar .chip-rail {
  flex-wrap: wrap; overflow: visible;
  -webkit-mask-image: none; mask-image: none;
}
html[data-uix="pulse"] .filter-bar .tag-chips { margin-top: 4px; }
/* If there are no active tags yet, hint where to manage them. */
html[data-uix="pulse"] .filter-bar::after {
  content: "Manage follow / filter tags in Me.";
  display: block; margin-top: 10px;
  font-size: 12px; color: var(--text-dim);
}

/* ===================== Center overlays (Search / Search-area) ===================== */
.pulse-overlay { position: fixed; inset: 0; z-index: 140; display: none; }
.pulse-overlay.open { display: block; }
.pulse-overlay-backdrop { position: absolute; inset: 0; background: var(--backdrop); }
.pulse-overlay-sheet {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(92vw, 380px);
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-heavy); padding: 18px;
}
.pulse-overlay-head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 14px;
}
.pulse-overlay-title { flex: 1 1 auto; min-width: 0; }
/* ✕ close — mirrors the drawers' .drawer-close so every pop-up shows one. */
.pulse-overlay-close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;   /* standardized close-✕ size (was 30) */
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text);
  cursor: pointer;
  transition: border-color .12s, color .12s;
}
.pulse-overlay-close:hover { border-color: var(--accent); color: var(--accent); }
.pulse-overlay-close svg { width: 16px; height: 16px; display: block; }
.pulse-overlay-body { display: flex; flex-direction: column; gap: 12px; align-items: stretch; }

/* Search-area overlay: title row carries a compact location tile on the right;
   the body is a single row of slider + distance chip. */
.pulse-radius-head { gap: 12px; }  /* base .pulse-overlay-head is already a flex row; title flexes, loc + ✕ sit right */
.pulse-radius-loc { display: inline-flex; flex-shrink: 0; }
.pulse-radius-loc #location-tile { width: 36px; height: 36px; }
.pulse-radius-body { flex-direction: row; align-items: center; gap: 12px; }
.pulse-radius-body #radius-slider { flex: 1; width: auto; }
.pulse-radius-body #radius-label { flex-shrink: 0; }
.pulse-overlay-go {
  margin-top: 16px; width: 100%; padding: 11px; font: inherit; font-weight: 600;
  border: none; background: var(--accent); color: #fff; border-radius: var(--radius); cursor: pointer;
}

/* ===================== Persistent search bar (under header) ===================== */
/* Bar-first search surface: fixed under the header, holds the real #mkt-search.
   --pulse-search-h is its (fixed) height — defined on :root so the feed scroller
   and the sticky breadcrumb (not descendants of the bar) can reserve/offset by it
   so the bar never overlaps them. */
:root { --pulse-search-h: 48px; }
.pulse-search-bar {
  position: fixed; top: calc(var(--top-bar-h, 56px) + env(safe-area-inset-top, 0px)); left: 0; right: 0; z-index: 45;
  box-sizing: border-box; height: var(--pulse-search-h);
  display: none; align-items: center; gap: 8px;
  padding: 8px 12px; background: var(--surface);
  border-bottom: 1px solid var(--border); box-shadow: var(--shadow-soft);
}
html[data-uix="pulse"] .pulse-search-bar { display: flex; }
.pulse-search-bar[hidden] { display: none !important; }
.pss-ic { display: flex; color: var(--text-dim); }
.pss-ic svg { width: 16px; height: 16px; }
/* The real #mkt-search input is relocated into the bar; strip its box chrome so
   it reads as an inline field between the icon and the ✕ (bar-first search). */
.pulse-search-bar .mkt-search-input {
  flex: 1; min-width: 0; font: inherit; color: var(--text);
  background: transparent; border: none; outline: none;
  height: auto; padding: 0; margin: 0; box-shadow: none;
  -webkit-appearance: none; appearance: none;
}
/* Our ✕ (close + restore Stage) replaces WebKit's native search-clear glyph. */
.pulse-search-bar .mkt-search-input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.pss-clear { display: flex; align-items: center; justify-content: center; min-width: 32px; min-height: 32px; padding: 2px; background: transparent; border: none; color: var(--text-dim); cursor: pointer; }
.pss-clear svg { width: 16px; height: 16px; }
/* When bar-first search is open, reserve the bar's height by SHRINKING the feed
   scrollport from the top (margin-top, on the flex:1 scroller). The sticky spatial
   breadcrumb (top:0) and band heads then pin to the new scrollport top — right
   below the bar — with no overlap. Margin (not padding) is used deliberately: it's
   immune to the inline `padding-top:8px` and spatial.css's `padding-top:0
   !important`, and it sidesteps iOS's quirky sticky-vs-scroll-padding behaviour. */
html[data-uix="pulse"] body.pulse-has-search #nearby-screen .screen-body {
  margin-top: var(--pulse-search-h, 48px);
}

/* ===================== Reserved bottom band (future Paid Shares) ===================== */
/* A calm white-space strip pinned to the bottom; the Pulse FAB floats over its
 * right corner. Placeholder copy now; real Paid Shares later (see PAID-SHARES.md). */
.pulse-paid-band {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: none; box-sizing: border-box;
  flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-align: center;
  min-height: 44px;
  /* Only the Pulse FAB (bottom-right) straddles the band now (Controller retired).
   * SYMMETRIC side padding centres the card on screen while the right clears the
   * FAB — the left has no control, it's purely for visual centering. */
  padding: 10px 84px calc(10px + env(safe-area-inset-bottom, 0px)) 84px;
  background: var(--surface); border-top: 1px solid var(--border);
  color: var(--text-dim); font-size: 12px; font-style: italic; line-height: 1.35;
}
/* iOS standalone PWA leaves a white gap below this fixed bottom bar (the home-
 * indicator safe-area isn't painted by the bar; Android has no such inset, so the
 * Pixel reaches the edge). Paint downward from the band with its OWN surface colour
 * so it reads as continuing to the screen edge. Off-screen / 0-effect where there's
 * no gap, so it's harmless on Android. */
.pulse-paid-band::after {
  content: ""; position: absolute; top: 100%; left: 0; right: 0; height: 120px;
  background: var(--surface); pointer-events: none;
}
html[data-uix="pulse"] body.pulse-on .pulse-paid-band { display: flex; }
/* Build-version stamp under the band copy — small, muted, not italic (a freshness check). */
.pulse-paid-ver {
  font-style: normal; font-size: 10px; font-weight: 700; letter-spacing: .04em;
  color: var(--text-dim); opacity: .7; font-variant-numeric: tabular-nums;
}
/* Keep the feed clear of the band so the last items aren't hidden behind it.
 * The band runs ~64px tall once it holds a Paid card, so 64px of clearance left
 * essentially zero gap — the feed's last row (often the "Nearby" bar) sat right
 * on the band's top edge and read as attached to it. Clear the band height AND
 * a deliberate gap so there's always visible space between them. */
html[data-uix="pulse"] body.pulse-on .screen-body {
  padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
}

/* ===================== Desktop command palette (⌘K) ===================== */
.pulse-cmdk { position: fixed; inset: 0; z-index: 142; display: none; }
.pulse-cmdk.open { display: block; }
.pulse-cmdk-backdrop { position: absolute; inset: 0; background: var(--backdrop); }
.pulse-cmdk-box {
  position: absolute; left: 50%; top: 14%; transform: translateX(-50%);
  width: min(92vw, 520px);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-heavy); overflow: hidden;
}
.pulse-cmdk-input {
  width: 100%; box-sizing: border-box; padding: 14px 16px;
  border: none; border-bottom: 1px solid var(--border);
  background: transparent; color: var(--text); font: inherit; font-size: 15px; outline: none;
  transition: border-color .12s ease;
}
/* Borderless input — accent its underline on focus (consistent with the other
   inputs' accent-border focus cue; matches .handle-input-row:focus-within). */
.pulse-cmdk-input:focus { border-bottom-color: var(--accent); }
.pulse-cmdk-list { max-height: 50vh; overflow-y: auto; padding: 6px; }
.pulse-cmdk-row {
  display: flex; align-items: center; gap: 10px; width: 100%;
  min-height: 44px;                       /* comfortable touch target (T9) */
  padding: 10px 12px; border: none; background: transparent; color: var(--text);
  font: inherit; text-align: left; cursor: pointer; border-radius: var(--radius);
}
.pulse-cmdk-row.active, .pulse-cmdk-row:hover { background: var(--surface-2); }
.pulse-cmdk-ic { display: flex; color: var(--text-dim); }
.pulse-cmdk-ic svg { width: 18px; height: 18px; }
.pulse-cmdk-empty { padding: 16px; color: var(--text-dim); text-align: center; }

/* ===================== First-run teach (T8) ===================== */
/* Visual layer is pointer-events:none so the user can actually grab the Pulse
 * and try the gesture; only the card's buttons are interactive. */
.pulse-teach { position: fixed; inset: 0; z-index: 100; display: none; pointer-events: none; }
.pulse-teach.open { display: block; }
.pulse-teach-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.5); }
.pulse-teach-ring {
  position: absolute;
  right: calc(6px + env(safe-area-inset-right, 0px));
  bottom: calc(6px + env(safe-area-inset-bottom, 0px));
  width: 68px; height: 68px; border-radius: 50%;
  border: 2px solid #fff; box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.18);
  animation: pulse-teach-ring 1.6s ease-out infinite;
}
@keyframes pulse-teach-ring {
  0% { transform: scale(0.9); opacity: 0.9; }
  70% { transform: scale(1.15); opacity: 0.3; }
  100% { transform: scale(0.9); opacity: 0.9; }
}
.pulse-teach-card {
  position: absolute; pointer-events: auto;
  right: calc(16px + env(safe-area-inset-right, 0px));
  bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  max-width: 248px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-heavy); padding: 14px 16px;
}
.pulse-teach-title { font-weight: 700; margin-bottom: 4px; }
.pulse-teach-body { font-size: 13px; color: var(--text-dim); line-height: 1.45; }
.pulse-teach-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.pulse-teach-skip { background: transparent; border: none; color: var(--text-dim); font: inherit; cursor: pointer; padding: 6px 10px; }
.pulse-teach-got { background: var(--accent); color: #fff; border: none; border-radius: var(--radius); font: inherit; font-weight: 600; cursor: pointer; padding: 6px 14px; }
@media (prefers-reduced-motion: reduce) { .pulse-teach-ring { animation: none; } }

/* ---- Radius dial: slider-at-thumb ----------------------------------------
   A vertical track that spawns under the finger on the Radius gesture. `left`
   is the CENTRE x (translateX(-50%)); `top` is the element's top edge. The thin
   track captures pointer events; the rest is click-through. */
.pulse-rdial {
  position: fixed; z-index: 152;
  transform: translate(-50%, 0) scale(0.92);
  transform-origin: center top;
  opacity: 0; transition: opacity .14s ease, transform .14s ease;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  pointer-events: none; user-select: none; -webkit-user-select: none;
  touch-action: none;
}
.pulse-rdial.in { opacity: 1; transform: translate(-50%, 0) scale(1); }
.pulse-rdial .prd-track {
  position: relative; width: 16px;
  background: color-mix(in oklab, var(--accent) 16%, var(--surface));
  border: 1px solid color-mix(in oklab, var(--accent) 30%, transparent);
  border-radius: 999px;
  box-shadow: 0 6px 22px var(--shadow-heavy);
  pointer-events: auto;   /* only the bar is grabbable */
}
.pulse-rdial .prd-fill {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: var(--accent); border-radius: 999px;
}
.pulse-rdial .prd-thumb {
  position: absolute; left: 50%; width: 30px; height: 30px;
  transform: translate(-50%, -50%);
  background: var(--accent); color: #fff;
  border: 2px solid var(--surface); border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .35);
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 700;
}
.pulse-rdial .prd-cap {
  font-size: .62rem; font-weight: 600; color: var(--text-dim); opacity: .8;
}
.pulse-rdial .prd-cap span { font-size: .5rem; opacity: .7; margin-left: 1px; }
@media (prefers-reduced-motion: reduce) {
  .pulse-rdial { transition: opacity .14s ease; transform: translate(-50%, 0); }
  .pulse-rdial.in { transform: translate(-50%, 0); }
}
