;(function () {
/* Bottom navigation pill — RN port of bottom-nav.jsx
   Uses expo-blur for the frost (Frost 4) and LinearGradient for the light source.
   Multi-layered box-shadow bevels are simplified to a single iOS shadow + 1px white border. */

/* Shared sliding pill geometry. The pill is a single Animated.View at the
   BottomNav root that translates horizontally between button centers. */
const PILL_W = 64;
const PILL_H = 48;
const PILL_R = PILL_H / 2;

/* Spring for snap/track animations. Stiffness 150 / damping 18 reads as
   confident but not jittery — settles in ~350ms without overshoot. */
const SPRING_CONFIG = { stiffness: 150, damping: 18, mass: 1 };
/* Drag threshold: gestures shorter than this are treated as taps and ignored
   by the pan responder so taps still propagate to the underlying Pressable. */
const DRAG_THRESHOLD = 4;

/* Inline JSX SVG icon components — pasted from `assets/icons/{home,wallet,news,bar-chart}.svg`,
   `stroke="currentColor"` replaced with `stroke={color}` so the parent can drive color. */
const HomeIcon = ({ width = 24, height = 24, color = '#000' }) => (
  <svg width={width} height={height} viewBox="0 0 24 24" fill="none">
    <path d="M3 10.182V19a1 1 0 0 0 1 1h4v-6h8v6h4a1 1 0 0 0 1-1v-8.818a2 2 0 0 0-.727-1.54l-7-5.833a2 2 0 0 0-2.546 0l-7 5.833A2 2 0 0 0 3 10.182Z" stroke={color} strokeWidth={2} strokeLinecap="round" strokeLinejoin="round"/>
  </svg>
);

const WalletIcon = ({ width = 24, height = 24, color = '#000' }) => (
  <svg width={width} height={height} viewBox="0 0 24 24" fill="none">
    <path d="M22 8.5H2M2 12.5H5.54668C6.08687 12.5 6.35696 12.5 6.61813 12.5466C6.84995 12.5879 7.0761 12.6563 7.29191 12.7506C7.53504 12.8567 7.75977 13.0065 8.20924 13.3062L8.79076 13.6938C9.24023 13.9935 9.46496 14.1433 9.70809 14.2494C9.9239 14.3437 10.15 14.4121 10.3819 14.4534C10.643 14.5 10.9131 14.5 11.4533 14.5H12.5467C13.0869 14.5 13.357 14.5 13.6181 14.4534C13.85 14.4121 14.0761 14.3437 14.2919 14.2494C14.535 14.1433 14.7598 13.9935 15.2092 13.6938L15.7908 13.3062C16.2402 13.0065 16.465 12.8567 16.7081 12.7506C16.9239 12.6563 17.15 12.5879 17.3819 12.5466C17.643 12.5 17.9131 12.5 18.4533 12.5H22M2 7.2L2 16.8C2 17.9201 2 18.4802 2.21799 18.908C2.40973 19.2843 2.71569 19.5903 3.09202 19.782C3.51984 20 4.07989 20 5.2 20L18.8 20C19.9201 20 20.4802 20 20.908 19.782C21.2843 19.5903 21.5903 19.2843 21.782 18.908C22 18.4802 22 17.9201 22 16.8V7.2C22 6.0799 22 5.51984 21.782 5.09202C21.5903 4.7157 21.2843 4.40974 20.908 4.21799C20.4802 4 19.9201 4 18.8 4L5.2 4C4.0799 4 3.51984 4 3.09202 4.21799C2.7157 4.40973 2.40973 4.71569 2.21799 5.09202C2 5.51984 2 6.07989 2 7.2Z" stroke={color} strokeWidth={2} strokeLinecap="round" strokeLinejoin="round"/>
  </svg>
);

const NewsIcon = ({ width = 17, height = 17, color = '#000' }) => (
  <svg width={width} height={height} viewBox="0 0 17 17" fill="none">
    <path d="M12.8333 7.41667H8.66667M12.8333 10.75H8.66667M12.8333 4.08333H8.66667M5.75 0.75L5.75 15.75M4.75 0.75H11.75C13.1501 0.75 13.8502 0.75 14.385 1.02248C14.8554 1.26217 15.2378 1.64462 15.4775 2.11502C15.75 2.6498 15.75 3.34987 15.75 4.75V11.75C15.75 13.1501 15.75 13.8502 15.4775 14.385C15.2378 14.8554 14.8554 15.2378 14.385 15.4775C13.8502 15.75 13.1501 15.75 11.75 15.75H4.75C3.34987 15.75 2.6498 15.75 2.11502 15.4775C1.64462 15.2378 1.26217 14.8554 1.02248 14.385C0.75 13.8502 0.75 13.1501 0.75 11.75V4.75C0.75 3.34987 0.75 2.6498 1.02248 2.11502C1.26217 1.64462 1.64462 1.26217 2.11502 1.02248C2.6498 0.75 3.34987 0.75 4.75 0.75Z" stroke={color} strokeWidth={1.5} strokeLinecap="round" strokeLinejoin="round"/>
  </svg>
);

const BarChartIcon = ({ width = 17, height = 17, color = '#000' }) => (
  <svg width={width} height={height} viewBox="0 0 17 17" fill="none">
    <path d="M4.91667 9.08333V12.4167M11.5833 7.41667V12.4167M8.25 4.08333V12.4167M4.75 15.75H11.75C13.1501 15.75 13.8502 15.75 14.385 15.4775C14.8554 15.2378 15.2378 14.8554 15.4775 14.385C15.75 13.8502 15.75 13.1501 15.75 11.75V4.75C15.75 3.34987 15.75 2.6498 15.4775 2.11502C15.2378 1.64462 14.8554 1.26217 14.385 1.02248C13.8502 0.75 13.1501 0.75 11.75 0.75H4.75C3.34987 0.75 2.6498 0.75 2.11502 1.02248C1.64462 1.26217 1.26217 1.64462 1.02248 2.11502C0.75 2.6498 0.75 3.34987 0.75 4.75V11.75C0.75 13.1501 0.75 13.8502 1.02248 14.385C1.26217 14.8554 1.64462 15.2378 2.11502 15.4775C2.6498 15.75 3.34987 15.75 4.75 15.75Z" stroke={color} strokeWidth={1.5} strokeLinecap="round" strokeLinejoin="round"/>
  </svg>
);

const NAV_ITEMS = [
  { key: 'home',        label: 'Home',      Icon: HomeIcon },
  { key: 'wallet',      label: 'Wallet',    Icon: WalletIcon },
  { key: 'news',        label: 'News',      Icon: NewsIcon },
  { key: 'performance', label: 'Portfolio', Icon: BarChartIcon },
];

/* Single nav button — icon centered inside a 64×48 hit area. The active-state
   pill no longer lives here; this component now ONLY renders the two crossfading
   icon layers (grey ↔ teal) driven by `isActive`. Animation: 450ms with
   Easing.out(Easing.cubic), opacity-only so useNativeDriver is safe. */
const NavBtn = ({ item, isActive, onPress, btnRef }) => {
  const { Icon } = item;

  return (
    <button ref={btnRef} onClick={onPress} style={{
      border: 'none',
      background: 'transparent',
      padding: 0,
      margin: 0,
      cursor: 'pointer',
      font: 'inherit',
      color: 'inherit',
      textAlign: 'inherit',
      ...styles.btn,
    }}>
      <div style={styles.btnInner}>
        <div style={{ ...styles.iconWrap, pointerEvents: 'none' }}>
          <div
            style={{
              ...styles.iconLayer,
              opacity: isActive ? 0 : 1,
              transition: 'opacity 450ms cubic-bezier(0.215, 0.61, 0.355, 1)',
              pointerEvents: 'none',
            }}
          >
            <Icon width={26} height={26} color={colors.muted3} />
          </div>
          <div
            style={{
              ...styles.iconLayer,
              opacity: isActive ? 1 : 0,
              transition: 'opacity 450ms cubic-bezier(0.215, 0.61, 0.355, 1)',
              pointerEvents: 'none',
            }}
          >
            <Icon width={26} height={26} color={colors.teal} />
          </div>
        </div>
      </div>
    </button>
  );
};

/* VoiceFAB lives at the App root now (components/voice-fab.jsx) so its
   smoke video keeps playing across home ↔ trade nav swaps. The fabSlot
   below is left as a transparent gap that the shared FAB sits on top of
   at the same x/y. */

/* Shared sliding pill — Figma glass recipe (BlurView + light gradient +
   dispersion + refraction rim + teal tint). Lives at BottomNav root and
   renders BEFORE the buttonRow, so the FAB (inside buttonRow) draws on top
   when the pill crosses the middle column. */
const SlidingPill = ({ translateX }) => {
  return (
    <div
      style={{
        ...styles.pillContainer,
        transform: `translateX(${translateX}px)`,
        pointerEvents: 'none',
      }}
    >
      <div style={styles.activePillBody}>
        <div
          style={{
            position: 'absolute', top: 0, left: 0, right: 0, bottom: 0,
            borderRadius: `${PILL_R}px`,
            backdropFilter: `blur(${3 * 0.7}px)`,
            WebkitBackdropFilter: `blur(${3 * 0.7}px)`,
          }}
        />
        {/* Light source from −45° / 80° */}
        <div
          style={{
            position: 'absolute', top: 0, left: 0, right: 0, bottom: 0,
            borderRadius: `${PILL_R}px`,
            background: 'linear-gradient(135deg, rgba(255,255,255,0.55) 0%, rgba(255,255,255,0.20) 30%, rgba(255,255,255,0) 70%, rgba(255,255,255,0.12) 100%)',
            pointerEvents: 'none',
          }}
        />
        {/* Dispersion — subtle chromatic edge */}
        <div
          style={{
            position: 'absolute', top: 0, left: 0, right: 0, bottom: 0,
            borderRadius: `${PILL_R}px`,
            background: 'linear-gradient(90deg, rgba(120,120,255,0.10) 0%, rgba(255,255,255,0) 50%, rgba(255,180,140,0.10) 100%)',
            pointerEvents: 'none',
          }}
        />
      </div>
    </div>
  );
};

const BottomNav = ({ active = 'home', onChange = () => {}, onVoice = () => {} }) => {
  /* Per-item layout cache: { [key]: { x, width } } where x is the button's
     left edge in buttonRow coordinates. Once all 4 buttons report, we can
     compute the centered pill x for each. */
  const [layouts, setLayouts] = React.useState({});
  const buttonRowRef = React.useRef(null);
  const navBtnRefs = React.useRef({});

  /* Layout measurement replaces RN onLayout: read each NavBtn's
     getBoundingClientRect() relative to the parent buttonRow.
     Run synchronously in useLayoutEffect so the first-settle pill x is
     applied in the same commit as `allMeasured` becoming true — no x=0 flash. */
  React.useLayoutEffect(() => {
    const rowEl = buttonRowRef.current;
    if (!rowEl) return;
    const rowRect = rowEl.getBoundingClientRect();
    const next = {};
    let allFound = true;
    for (const item of NAV_ITEMS) {
      const el = navBtnRefs.current[item.key];
      if (!el) { allFound = false; continue; }
      const r = el.getBoundingClientRect();
      next[item.key] = { x: r.left - rowRect.left, width: r.width };
    }
    if (allFound) {
      setLayouts(next);
      // First-settle: compute target for active key and apply synchronously
      // so SlidingPill's first paint is at the correct x (not 0).
      if (isFirstSettleRef.current) {
        const l = next[active];
        if (l) {
          const t = l.x + l.width / 2 - PILL_W / 2;
          isFirstSettleRef.current = false;
          pillXRef.current = t;
          setPillX(t);
        }
      }
    }
  }, []);

  /* Pill x-target per item: button center − pill half-width. Computed once
     all buttons have reported; stable map keyed by item.key. */
  const targets = React.useMemo(() => {
    const out = {};
    for (const item of NAV_ITEMS) {
      const l = layouts[item.key];
      if (l) out[item.key] = l.x + l.width / 2 - PILL_W / 2;
    }
    return out;
  }, [layouts]);

  const allMeasured = NAV_ITEMS.every((i) => layouts[i.key]);

  /* Single state value for pill translateX. Driven by spring on `active`
     changes and during drag-release snap; set directly during pan. */
  const [pillX, setPillX] = React.useState(0);
  /* Mirror of the current pill x as a plain number — needed inside the
     pointer handler closures for synchronous reads during gestures. */
  const pillXRef = React.useRef(0);

  /* When `active` changes (or first measurement arrives), spring to that
     button's x. Skip while user is dragging. */
  const draggingRef = React.useRef(false);
  const isFirstSettleRef = React.useRef(true);
  const cancelSpringRef = React.useRef(null);

  React.useEffect(() => {
    if (!allMeasured) return;
    if (draggingRef.current) return;
    if (isFirstSettleRef.current) return; // first settle handled in useLayoutEffect
    const target = targets[active];
    if (target == null) return;
    if (cancelSpringRef.current) cancelSpringRef.current();
    cancelSpringRef.current = springTo(
      pillXRef.current,
      target,
      SPRING_CONFIG,
      (x) => {
        pillXRef.current = x;
        setPillX(x);
      }
    );
    pillXRef.current = target;
  }, [active, allMeasured, targets]);

  /* Pre-compute drag clamp range and the snap candidate list (excludes FAB
     since the FAB slot is not a navigable destination). */
  const dragRange = React.useMemo(() => {
    if (!allMeasured) return null;
    const xs = NAV_ITEMS.map((i) => targets[i.key]);
    return { min: Math.min(...xs), max: Math.max(...xs) };
  }, [allMeasured, targets]);

  /* Pointer handlers — translate the pill with the finger and snap to the
     nearest non-FAB button on release. Tap-friendly: only captures the
     gesture once horizontal movement exceeds DRAG_THRESHOLD, so taps on
     buttons still reach the underlying button. */
  const pointerStartXRef = React.useRef(0);
  const dragStartXRef = React.useRef(0);
  const pointerIdRef = React.useRef(null);
  const pointerActiveRef = React.useRef(false);

  const handlePointerDown = (e) => {
    pointerActiveRef.current = true;
    pointerStartXRef.current = e.clientX;
    dragStartXRef.current = pillXRef.current;
    pointerIdRef.current = e.pointerId;
    // Don't capture yet — wait until movement exceeds threshold so taps still propagate.
  };

  const handlePointerMove = (e) => {
    if (!pointerActiveRef.current) return;
    if (!dragRange) return;
    const dx = e.clientX - pointerStartXRef.current;
    if (!draggingRef.current && Math.abs(dx) > DRAG_THRESHOLD) {
      draggingRef.current = true;
      // Once we know it's a drag, capture the pointer so we get all subsequent events.
      try { e.currentTarget.setPointerCapture(pointerIdRef.current); } catch (_) {}
      // Cancel any in-flight spring so the drag takes over.
      if (cancelSpringRef.current) { cancelSpringRef.current(); cancelSpringRef.current = null; }
    }
    if (draggingRef.current) {
      const next = Math.max(dragRange.min, Math.min(dragRange.max, dragStartXRef.current + dx));
      pillXRef.current = next;
      setPillX(next);
    }
  };

  const handlePointerUp = (e) => {
    if (!pointerActiveRef.current) return;
    pointerActiveRef.current = false;
    try { e.currentTarget.releasePointerCapture(pointerIdRef.current); } catch (_) {}
    const wasDragging = draggingRef.current;
    draggingRef.current = false;
    if (!wasDragging) return;
    if (!allMeasured) return;
    const current = pillXRef.current;
    let nearestKey = NAV_ITEMS[0].key;
    let nearestDist = Infinity;
    for (const item of NAV_ITEMS) {
      const d = Math.abs(current - targets[item.key]);
      if (d < nearestDist) { nearestDist = d; nearestKey = item.key; }
    }
    const target = targets[nearestKey];
    if (cancelSpringRef.current) cancelSpringRef.current();
    /* Fire onChange BEFORE the snap spring so the page cross-fade runs
       in parallel with the pill settle (was previously gated to the
       spring's complete callback, which felt like a 350ms pause
       between release and the page reacting). */
    if (nearestKey !== active) onChange(nearestKey);
    cancelSpringRef.current = springTo(
      pillXRef.current,
      target,
      SPRING_CONFIG,
      (x) => {
        pillXRef.current = x;
        setPillX(x);
      }
    );
    pillXRef.current = target;
  };

  const handlePointerCancel = (e) => {
    if (!pointerActiveRef.current) return;
    pointerActiveRef.current = false;
    try { e.currentTarget.releasePointerCapture(pointerIdRef.current); } catch (_) {}
    const wasDragging = draggingRef.current;
    draggingRef.current = false;
    if (!wasDragging) return;
    if (!allMeasured) return;
    const target = targets[active];
    if (target != null) {
      if (cancelSpringRef.current) cancelSpringRef.current();
      cancelSpringRef.current = springTo(
        pillXRef.current,
        target,
        SPRING_CONFIG,
        (x) => {
          pillXRef.current = x;
          setPillX(x);
        }
      );
      pillXRef.current = target;
    }
  };

  return (
    <div style={{ ...styles.outer, pointerEvents: 'none' }}>
      {/* Visual glass capsule — clips BlurView + gradients inside the rounded silhouette.
         Figma "Glass" settings translated to RN:
           Light 0°/100% → top-down white gradient (L2)
           Refraction 80 → bright top-edge highlight line (L3)
           Dispersion 50 → faint chromatic edge tint at bottom (L4)
           Depth 100    → existing drop shadow on glassCapsule (kept)
           Frost 4      → BlurView intensity reduced from 40 → 6 (sharper glass)
           Splay 0      → no spread layer */}
      <div style={{ ...styles.glassCapsule, pointerEvents: 'auto' }}>
        {/* L1 · Frost — bumped +100% (6 → 12) so the pill reads as glass with
           a real haze behind it while still keeping the refraction/dispersion
           edges visible.

           IMPORTANT: borderRadius must be set explicitly on this element.
           backdrop-filter is NOT clipped by the parent's border-radius even
           when the parent has overflow:hidden — browsers render the filter
           in the child's rectangular bounding box, which makes the blur
           leak past the pill's rounded ends as visible "corner" artifacts
           at the four corners of the pill's bounding rect. Matching the
           pill's br:100 here clips the blur to the same capsule shape. */}
        <div style={{
          position: 'absolute', top: 0, left: 0, right: 0, bottom: 0,
          borderRadius: '100px',
          backdropFilter: `blur(${12 * 0.7}px)`,
          WebkitBackdropFilter: `blur(${12 * 0.7}px)`,
        }} />
        {/* L2 · Light source from 0°/100° — bright top crest fading down */}
        <div style={{
          position: 'absolute', top: 0, left: 0, right: 0, bottom: 0,
          background: 'linear-gradient(180deg, rgba(255,255,255,1.0) 0%, rgba(255,255,255,0.45) 7%, rgba(255,255,255,0.10) 18%, rgba(255,255,255,0) 55%, rgba(255,255,255,0.18) 100%)',
          pointerEvents: 'none',
        }}/>
        {/* L3 · Refraction — bumped +25% in both intensity and thickness.
           Edge stops 0.2 → 0.25, peak clamped at 1.0 (was 0.95); height
           1.5 → 2 in the stylesheet. Reads as a brighter, slightly thicker
           refractive crest at the top edge of the glass. */}
        <div style={{
          ...styles.refractionTop,
          background: 'linear-gradient(90deg, rgba(255,255,255,0.25) 0%, rgba(255,255,255,1.0) 50%, rgba(255,255,255,0.25) 100%)',
          pointerEvents: 'none',
        }}/>
        {/* L4 · Dispersion — subtle chromatic split at the bottom edge.
           Cool blue on the left, warm amber on the right with a transparent
           middle, simulating the wavelength fan-out you get at a glass edge. */}
        <div style={{
          ...styles.dispersionBottom,
          background: 'linear-gradient(90deg, rgba(120,120,255,0.10) 0%, rgba(255,255,255,0) 50%, rgba(255,180,140,0.10) 100%)',
          pointerEvents: 'none',
        }}/>
      </div>

      {/* Edge rim — sits on top of the glass, no overflow clipping needed */}
      <div style={{ ...styles.rim, pointerEvents: 'none' }} />

      {/* Shared sliding pill — rendered BEFORE the buttonRow so the FAB
         (inside buttonRow) draws on top when the pill crosses the middle. */}
      {allMeasured && (
        <SlidingPill translateX={pillX} />
      )}

      {/* Button row — separate from the clipped capsule so the FAB can overflow upward.
         The FAB cutout now lives INSIDE VoiceFAB as a sibling of fabRing, so its halo
         is geometrically locked to the fabRing position regardless of flex layout.
         pointerEvents="box-none" makes the buttonRow View itself invisible to
         hit-testing — pure taps land on its children (NavBtn / FAB Pressables) —
         while still allowing RN's responder negotiation to walk UP the tree on
         move, so panResponder can claim horizontal drags once |dx| > DRAG_THRESHOLD. */}
      <div
        ref={buttonRowRef}
        style={{ ...styles.buttonRow, pointerEvents: 'auto' }}
        onPointerDown={handlePointerDown}
        onPointerMove={handlePointerMove}
        onPointerUp={handlePointerUp}
        onPointerCancel={handlePointerCancel}
      >
        <NavBtn
          item={NAV_ITEMS[0]}
          isActive={active === NAV_ITEMS[0].key}
          onPress={() => { if (!draggingRef.current) onChange(NAV_ITEMS[0].key); }}
          btnRef={(el) => { navBtnRefs.current[NAV_ITEMS[0].key] = el; }}
        />
        <NavBtn
          item={NAV_ITEMS[1]}
          isActive={active === NAV_ITEMS[1].key}
          onPress={() => { if (!draggingRef.current) onChange(NAV_ITEMS[1].key); }}
          btnRef={(el) => { navBtnRefs.current[NAV_ITEMS[1].key] = el; }}
        />
        <div style={styles.fabSlot}>
          {/* Empty — shared <VoiceFAB> at App root sits over this slot. */}
        </div>
        <NavBtn
          item={NAV_ITEMS[2]}
          isActive={active === NAV_ITEMS[2].key}
          onPress={() => { if (!draggingRef.current) onChange(NAV_ITEMS[2].key); }}
          btnRef={(el) => { navBtnRefs.current[NAV_ITEMS[2].key] = el; }}
        />
        <NavBtn
          item={NAV_ITEMS[3]}
          isActive={active === NAV_ITEMS[3].key}
          onPress={() => { if (!draggingRef.current) onChange(NAV_ITEMS[3].key); }}
          btnRef={(el) => { navBtnRefs.current[NAV_ITEMS[3].key] = el; }}
        />
      </div>
    </div>
  );
};

const styles = {
  outer: {
    position: 'absolute',
    left: '16px', right: '16px', bottom: 0,
    height: '120px', // 28 (gap below) + 58 (pill) + ~34 (FAB headroom above pill)
    zIndex: 50,
  },
  glassCapsule: {
    position: 'absolute',
    left: 0, right: 0, bottom: '28px',
    height: '58px',
    borderRadius: '100px',
    overflow: 'hidden',
    backgroundColor: 'rgba(255,255,255,0.10)',
    boxShadow: '0px 12px 32px rgba(16, 24, 40, 0.16)',
  },
  rim: {
    position: 'absolute',
    left: 0, right: 0, bottom: '28px',
    height: '58px',
    borderRadius: '100px',
    border: '1.5px solid rgba(255,255,255,0.7)',
  },
  /* Refraction — bright crest pinned to the very top of the glass capsule. */
  refractionTop: {
    position: 'absolute',
    top: 0, left: 0, right: 0,
    height: '2px', // 1.5 +25% → 1.875, rounded to 2
  },
  /* Dispersion — subtle chromatic tint pinned to the very bottom of the capsule. */
  dispersionBottom: {
    position: 'absolute',
    bottom: 0, left: 0, right: 0,
    height: '2px',
  },
  /* Shared sliding pill container. Lives in buttonRow's coordinate space —
     vertically centered inside the 58-tall row, horizontally translated via
     the Animated.Value. translateX is set to the button's left x + half-width
     − PILL_W/2 so the pill is centered on each button. */
  pillContainer: {
    position: 'absolute',
    left: 0,
    bottom: `${28 + (58 - PILL_H) / 2}px`, // align pill vertical center with row center → 33
    width: `${PILL_W}px`,
    height: `${PILL_H}px`,
  },
  buttonRow: {
    position: 'absolute',
    left: 0, right: 0, bottom: '28px',
    height: '58px',
    display: 'flex',
    flexDirection: 'row',
    paddingLeft: '4px',
    paddingRight: '4px',
    alignItems: 'center',
    justifyContent: 'center',
  },
  btn: {
    flex: 1,
    maxWidth: '77px',
    height: '50px',
    display: 'flex',
    alignItems: 'center',
    justifyContent: 'center',
  },
  /* btnInner — 64×48 area that hugs the navbar's inner edges (5px from top/
     bottom of the 58-tall pill). Fixed size so the icon hit area matches the
     pill geometry. */
  btnInner: {
    width: '64px',
    height: '48px',
    borderRadius: '24px',
    display: 'flex',
    alignItems: 'center',
    justifyContent: 'center',
    position: 'relative',
  },
  /* Visible pill surface — teal tint + white refraction rim + clipped glass
     layers. overflow:'hidden' clips the BlurView + gradients to the rounded
     silhouette, killing any white-square peeking around the edges. */
  activePillBody: {
    position: 'absolute',
    top: 0, left: 0, right: 0, bottom: 0,
    borderRadius: `${PILL_R}px`,
    backgroundColor: 'rgba(0,175,171,0.20)',
    border: '1px solid rgba(255,255,255,0.75)',
    overflow: 'hidden',
  },
  iconWrap: {
    width: '26px',
    height: '26px',
    display: 'flex',
    alignItems: 'center',
    justifyContent: 'center',
    position: 'relative',
  },
  iconLayer: {
    position: 'absolute',
    top: 0, left: 0, right: 0, bottom: 0,
    display: 'flex',
    alignItems: 'center',
    justifyContent: 'center',
  },
  fabSlot: {
    flex: 1,
    maxWidth: '77px',
    display: 'flex',
    alignItems: 'center',
    justifyContent: 'center',
  },
  /* fabWrap — 76×76 box (matches fabRing) that carries the translateY:-22 lift.
     The cutout and ring are positioned relative to this wrap, NOT to the flex
     parents, so their halo geometry is independent of buttonRow's layout. */
  fabWrap: {
    width: '76px',
    height: '76px',
    transform: 'translateY(-22px)',
    position: 'relative',
  },
  /* Cutout — 86×86 grey circle, offset top:-5/left:-5 to extend a uniform 5px
     halo around fabRing (which fills the 76×76 fabWrap at top:0/left:0).
     Explicit offsets on all four sides → halo is symmetric by construction. */
  fabCutout: {
    position: 'absolute',
    top: '-5px',
    left: '-5px',
    width: '86px',
    height: '86px',
    borderRadius: '43px',
    backgroundColor: colors.bg, // matches the body bg behind the pill
  },
  /* Outer ring — 76×76 white circle that surrounds the teal FAB. Sits at top:0/
     left:0 of fabWrap. translateY now lives on fabWrap so the whole group lifts
     together; the cutout halo around fabRing is preserved. */
  fabRing: {
    position: 'absolute',
    top: 0,
    left: 0,
    width: '76px',
    height: '76px',
    borderRadius: '38px',
    backgroundColor: '#fff',
    display: 'flex',
    alignItems: 'center',
    justifyContent: 'center',
    /* Centered shadow (offset 0,0) so the teal glow surrounds the FAB evenly. */
    boxShadow: '0px 0px 24px rgba(0, 175, 171, 0.4)',
  },
  /* Inner FAB — 68×68 teal disc with the smoke video. */
  fab: {
    width: '68px',
    height: '68px',
    borderRadius: '34px',
    backgroundColor: colors.teal,
    overflow: 'hidden',
  },
  fabVideo: {
    width: '100%',
    height: '100%',
  },
};

Object.assign(window, { BottomNav });
})();
