// ═══════════════════════════════════════════════════════════════════════
// Dyra — Mobile-native redesign (iPhone-first)
// ═══════════════════════════════════════════════════════════════════════
// Completely separate component tree from the desktop site. Designed for a
// 402px-wide iPhone viewport. Each screen is its own root that fills the
// device frame + scrolls naturally. No scaling tricks — real responsive
// layouts with mobile-appropriate font sizes, touch targets, and chrome.
//
// Shared with the desktop:
//   • window.DYRA (seed property data + content)
//   • window.DyraStore (live state, reservations, content overrides)
//   • window.Placeholder (striped placeholder + photo wrapper)
//
// Design system (matches the brand, scaled for mobile):
//   PALETTE — terracotta accent on warm paper, deep umber ink
//   TYPE    — Cormorant Garamond serif for editorial headlines
//             Inter sans for UI + body
//             Frank Ruhl Libre for Hebrew accents
//   SPACING — 8/12/16/20/24/32/40/56 px scale
//   RADII   — 8 / 12 / 18 / 24 (cards / sheets)
//   TARGETS — 44pt minimum hit area (Apple HIG)
//
// All screens share window.DyraMobile namespace.
// ═══════════════════════════════════════════════════════════════════════

const DYRA_MOBILE_PALETTE = {
  bg:         '#f5efe3',  // warm paper
  surface:    '#ffffff',  // cards
  card:       '#fbf6ea',  // raised section
  ink:        '#2a241c',  // text
  inkSoft:    '#5b4f3a',
  muted:      '#6b5e47',
  line:       '#d9cfba',
  lineSoft:   '#e8dfc8',
  accent:     '#b8532a',  // terracotta
  accentSoft: '#f1d8c5',
  accentDark: '#8a3e1f',
  shabbos:    '#7a5a2e',
  success:    '#3d6b4a',
  danger:     '#a8412e',
};

const DYRA_MOBILE_TYPE = {
  serif:   "'Cormorant Garamond', Georgia, serif",
  sans:    "Inter, -apple-system, BlinkMacSystemFont, system-ui, sans-serif",
  hebrew:  "'Frank Ruhl Libre', 'Noto Serif Hebrew', serif",
};

// ─── Tiny shared atoms ────────────────────────────────────────────────
function MEyebrow({ children, color, style }) {
  return (
    <div style={{
      fontSize: 10, letterSpacing: '0.22em', textTransform: 'uppercase',
      color: color || DYRA_MOBILE_PALETTE.accent, fontWeight: 500,
      ...style,
    }}>{children}</div>
  );
}

function MIconBtn({ children, onClick, label, size = 44 }) {
  return (
    <button
      onClick={onClick}
      aria-label={label}
      style={{
        width: size, height: size, padding: 0,
        background: 'transparent', border: 'none',
        display: 'flex', alignItems: 'center', justifyContent: 'center',
        cursor: 'pointer', color: DYRA_MOBILE_PALETTE.ink,
        WebkitTapHighlightColor: 'transparent',
      }}
    >
      {children}
    </button>
  );
}

// SF-style stroke icons — simple, clean, uniform 1.6 stroke
function MIco({ name, size = 22, color }) {
  const c = color || 'currentColor';
  const s = { width: size, height: size, fill: 'none', stroke: c, strokeWidth: 1.6, strokeLinecap: 'round', strokeLinejoin: 'round' };
  switch (name) {
    case 'menu':    return <svg viewBox="0 0 24 24" {...s}><path d="M4 7h16M4 12h16M4 17h16"/></svg>;
    case 'close':   return <svg viewBox="0 0 24 24" {...s}><path d="M6 6l12 12M18 6L6 18"/></svg>;
    case 'back':    return <svg viewBox="0 0 24 24" {...s}><path d="M15 5l-7 7 7 7"/></svg>;
    case 'forward': return <svg viewBox="0 0 24 24" {...s}><path d="M9 5l7 7-7 7"/></svg>;
    case 'search':  return <svg viewBox="0 0 24 24" {...s}><circle cx="11" cy="11" r="7"/><path d="M21 21l-4.5-4.5"/></svg>;
    case 'home':    return <svg viewBox="0 0 24 24" {...s}><path d="M3 11l9-7 9 7v9a2 2 0 01-2 2h-4v-7h-6v7H5a2 2 0 01-2-2v-9z"/></svg>;
    case 'star':    return <svg viewBox="0 0 24 24" {...s} fill={c} strokeWidth="0"><path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"/></svg>;
    case 'heart':   return <svg viewBox="0 0 24 24" {...s}><path d="M20.84 4.61a5.5 5.5 0 00-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 00-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 000-7.78z"/></svg>;
    case 'calendar':return <svg viewBox="0 0 24 24" {...s}><rect x="3" y="5" width="18" height="16" rx="2"/><path d="M3 10h18M8 3v4M16 3v4"/></svg>;
    case 'users':   return <svg viewBox="0 0 24 24" {...s}><circle cx="9" cy="8" r="3.5"/><path d="M3 20c0-3 2.5-5 6-5s6 2 6 5"/><circle cx="17" cy="9" r="2.5"/><path d="M16 14c2.5 0 5 1.5 5 4"/></svg>;
    case 'check':   return <svg viewBox="0 0 24 24" {...s}><path d="M5 12l5 5 9-11"/></svg>;
    case 'plus':    return <svg viewBox="0 0 24 24" {...s}><path d="M12 5v14M5 12h14"/></svg>;
    case 'minus':   return <svg viewBox="0 0 24 24" {...s}><path d="M5 12h14"/></svg>;
    case 'phone':   return <svg viewBox="0 0 24 24" {...s}><path d="M22 16.92v3a2 2 0 01-2.18 2 19.79 19.79 0 01-8.63-3.07 19.5 19.5 0 01-6-6 19.79 19.79 0 01-3.07-8.67A2 2 0 014.11 2h3a2 2 0 012 1.72 12.84 12.84 0 00.7 2.81 2 2 0 01-.45 2.11L8.09 9.91a16 16 0 006 6l1.27-1.27a2 2 0 012.11-.45 12.84 12.84 0 002.81.7A2 2 0 0122 16.92z"/></svg>;
    case 'mail':    return <svg viewBox="0 0 24 24" {...s}><rect x="3" y="5" width="18" height="14" rx="2"/><path d="M3 7l9 6 9-6"/></svg>;
    case 'pin':     return <svg viewBox="0 0 24 24" {...s}><path d="M12 22s8-7 8-13a8 8 0 00-16 0c0 6 8 13 8 13z"/><circle cx="12" cy="9" r="2.5"/></svg>;
    case 'wifi':    return <svg viewBox="0 0 24 24" {...s}><path d="M5 12.55a11 11 0 0114 0M8.5 16a6 6 0 017 0M2 8.82a15 15 0 0120 0"/><circle cx="12" cy="20" r="0.8" fill={c}/></svg>;
    case 'bed':     return <svg viewBox="0 0 24 24" {...s}><path d="M2 17v-7a2 2 0 012-2h16a2 2 0 012 2v7M2 17h20M6 8V6a2 2 0 012-2h2a2 2 0 012 2v2"/></svg>;
    case 'bath':    return <svg viewBox="0 0 24 24" {...s}><path d="M3 12h18v3a4 4 0 01-4 4H7a4 4 0 01-4-4v-3zM7 12V6a2 2 0 014 0M5 19v2M19 19v2"/></svg>;
    case 'shield':  return <svg viewBox="0 0 24 24" {...s}><path d="M12 2l8 4v6c0 5-3.5 9-8 10-4.5-1-8-5-8-10V6l8-4z"/></svg>;
    case 'sparkle': return <svg viewBox="0 0 24 24" {...s}><path d="M12 3l1.5 4.5L18 9l-4.5 1.5L12 15l-1.5-4.5L6 9l4.5-1.5L12 3zM5 17l1 2 2 1-2 1-1 2-1-2-2-1 2-1 1-2zM18 17l.7 1.3L20 19l-1.3.7L18 21l-.7-1.3L16 19l1.3-.7L18 17z" fill={c}/></svg>;
    case 'flame':   return <svg viewBox="0 0 24 24" {...s}><path d="M12 3s5 4.5 5 9.5a5 5 0 11-10 0c0-2 1-3 1-3s.5 1.5 2 1.5C9 8 12 6 12 3z"/></svg>;
    case 'candle':  return <svg viewBox="0 0 24 24" {...s}><path d="M12 3c1.5 1.5 1.5 3 0 4-1.5-1-1.5-2.5 0-4z"/><rect x="9" y="9" width="6" height="12" rx="1"/><path d="M9 13h6"/></svg>;
    case 'doc':     return <svg viewBox="0 0 24 24" {...s}><path d="M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6z"/><path d="M14 2v6h6M8 13h8M8 17h6"/></svg>;
    case 'briefcase':return <svg viewBox="0 0 24 24" {...s}><rect x="2" y="7" width="20" height="14" rx="2"/><path d="M16 7V5a2 2 0 00-2-2h-4a2 2 0 00-2 2v2"/></svg>;
    case 'whatsapp':return <svg viewBox="0 0 24 24" fill={c} stroke="none"><path d="M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51l-.57-.01c-.198 0-.52.074-.792.372s-1.04 1.016-1.04 2.479 1.065 2.876 1.213 3.074c.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347zM12 2C6.477 2 2 6.477 2 12c0 1.89.525 3.658 1.438 5.168L2 22l4.832-1.438A9.96 9.96 0 0012 22c5.523 0 10-4.477 10-10S17.523 2 12 2zm0 18a7.96 7.96 0 01-4.063-1.118l-.291-.173-3.018.798.806-2.948-.19-.302A7.96 7.96 0 014 12c0-4.418 3.582-8 8-8s8 3.582 8 8-3.582 8-8 8z"/></svg>;
    default: return <svg viewBox="0 0 24 24" {...s}><circle cx="12" cy="12" r="9"/></svg>;
  }
}

// ─── Mobile primary button — full-width, 56h, accent ────────────────
function MButton({ children, onClick, variant = 'primary', size = 'lg', style, disabled }) {
  const p = DYRA_MOBILE_PALETTE;
  const heights = { sm: 40, md: 48, lg: 56 };
  const h = heights[size] || 56;
  const variants = {
    primary:   { bg: p.accent,        fg: '#fff',      border: 'none' },
    secondary: { bg: 'transparent',   fg: p.ink,       border: `1.5px solid ${p.line}` },
    dark:      { bg: p.ink,           fg: p.bg,        border: 'none' },
    soft:      { bg: p.accentSoft,    fg: p.accentDark,border: 'none' },
    ghost:     { bg: 'transparent',   fg: p.accent,    border: 'none' },
  };
  const v = variants[variant] || variants.primary;
  return (
    <button
      onClick={onClick}
      disabled={disabled}
      style={{
        width: '100%', height: h, borderRadius: h / 2,
        background: v.bg, color: v.fg, border: v.border,
        fontFamily: DYRA_MOBILE_TYPE.sans,
        fontSize: size === 'sm' ? 13 : 15, fontWeight: 500, letterSpacing: '0.01em',
        cursor: disabled ? 'not-allowed' : 'pointer',
        opacity: disabled ? 0.5 : 1,
        WebkitTapHighlightColor: 'transparent',
        transition: 'transform 80ms, opacity 120ms',
        ...style,
      }}
      onTouchStart={e => { e.currentTarget.style.transform = 'scale(0.98)'; }}
      onTouchEnd={e => { e.currentTarget.style.transform = ''; }}
    >
      {children}
    </button>
  );
}

// ─── Sticky top app bar ───────────────────────────────────────────────
// Universal mobile top bar — same layout on every screen:
//   [ logo (tap → home) ] [ Parshas X (Hebcal) ] [ hamburger (open menu) ]
// Legacy `title`, `leading`, `trailing` props are accepted for backward
// compatibility but ignored — the bar renders its own fixed layout so
// nothing varies between screens. Hamburger taps fire a window
// `dyra-open-menu` event that the shell listens for, so screens that
// don't receive an `openMenu` prop (stay-detail, booking, admin-res)
// still get a working menu.
function MAppBar({ scrolled, transparent, go }) {
  const p = DYRA_MOBILE_PALETTE;
  const homeNav = () => {
    if (typeof go === 'function') go('home');
    else if (typeof window !== 'undefined') window.location.hash = 'home';
  };
  const openMenu = () => {
    if (typeof window !== 'undefined') {
      window.dispatchEvent(new CustomEvent('dyra-open-menu'));
    }
  };
  const parsha = (typeof window !== 'undefined' && window.DYRA?.PARSHA?.[0]) || null;
  const centerOpacity = transparent && !scrolled ? 0 : 1;
  return (
    <div style={{
      position: 'sticky', top: 0, zIndex: 50,
      background: transparent
        ? (scrolled ? 'rgba(245,239,227,0.92)' : 'transparent')
        : 'rgba(245,239,227,0.92)',
      backdropFilter: 'saturate(180%) blur(14px)',
      WebkitBackdropFilter: 'saturate(180%) blur(14px)',
      borderBottom: scrolled ? `0.5px solid ${p.line}` : '0.5px solid transparent',
      transition: 'background 200ms, border-color 200ms',
      display: 'flex', alignItems: 'center', justifyContent: 'space-between',
      padding: '0 8px',
      height: 56,
    }}>
      {/* Left: logo (tap → home) */}
      <button
        onClick={homeNav}
        aria-label="Home"
        style={{
          width: 44, height: 44, padding: 0,
          background: 'transparent', border: 'none',
          display: 'flex', alignItems: 'center', justifyContent: 'center',
          cursor: 'pointer',
          WebkitTapHighlightColor: 'transparent',
        }}
      >
        <img
          src={(typeof window !== 'undefined' && window.DYRA_LOGO) || 'assets/dyra-logo.png'}
          alt="Dyra"
          style={{ width: 32, height: 32, borderRadius: 6, objectFit: 'cover', display: 'block' }}
        />
      </button>

      {/* Center: parsha widget */}
      <div style={{
        flex: 1,
        display: 'flex', alignItems: 'center', justifyContent: 'center',
        opacity: centerOpacity,
        transition: 'opacity 200ms',
        minWidth: 0,
      }}>
        {parsha && (
          <div style={{
            display: 'flex', flexDirection: 'column', alignItems: 'center',
            lineHeight: 1.05,
          }}>
            <span style={{
              fontSize: 8, letterSpacing: '0.18em', textTransform: 'uppercase',
              color: p.shabbos, fontFamily: DYRA_MOBILE_TYPE.sans, fontWeight: 500,
            }}>This Shabbos</span>
            <span style={{
              fontFamily: DYRA_MOBILE_TYPE.serif, fontSize: 15, fontWeight: 500, color: p.ink,
              whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', maxWidth: 240,
            }}>
              Parshas {parsha.parsha}
            </span>
          </div>
        )}
      </div>

      {/* Right: hamburger menu */}
      <MIconBtn onClick={openMenu} label="Menu" size={44}>
        <MIco name="menu" size={22}/>
      </MIconBtn>
    </div>
  );
}

// ─── Bottom tab bar (5 items) ─────────────────────────────────────────
function MTabBar({ current, go }) {
  const p = DYRA_MOBILE_PALETTE;
  const tabs = [
    { id: 'home',     label: 'Home',     icon: 'home' },
    { id: 'browse',   label: 'Browse',   icon: 'search' },
    { id: 'stays',    label: 'Stays',    icon: 'calendar' },
    { id: 'menu',     label: 'Menu',     icon: 'menu' },
  ];
  return (
    <div style={{
      position: 'sticky', bottom: 0, zIndex: 50,
      background: 'rgba(245,239,227,0.94)',
      backdropFilter: 'saturate(180%) blur(14px)',
      WebkitBackdropFilter: 'saturate(180%) blur(14px)',
      borderTop: `0.5px solid ${p.line}`,
      display: 'grid', gridTemplateColumns: 'repeat(4, 1fr)',
      paddingBottom: 22, paddingTop: 8,
    }}>
      {tabs.map(t => {
        const active = current === t.id;
        return (
          <button
            key={t.id}
            onClick={() => go(t.id)}
            style={{
              background: 'transparent', border: 'none',
              padding: '4px 0',
              display: 'flex', flexDirection: 'column', alignItems: 'center', gap: 3,
              color: active ? p.accent : p.muted,
              fontFamily: DYRA_MOBILE_TYPE.sans, fontSize: 10, fontWeight: 500,
              letterSpacing: '0.02em',
              cursor: 'pointer', WebkitTapHighlightColor: 'transparent',
            }}
          >
            <MIco name={t.icon} size={22}/>
            <span>{t.label}</span>
          </button>
        );
      })}
    </div>
  );
}

// ─── Slide-up bottom sheet ────────────────────────────────────────────
function MSheet({ open, onClose, children, title, height = '85%' }) {
  const p = DYRA_MOBILE_PALETTE;
  if (!open) return null;
  return (
    <div style={{
      position: 'absolute', inset: 0, zIndex: 100,
      display: 'flex', flexDirection: 'column', justifyContent: 'flex-end',
    }}>
      {/* scrim */}
      <div
        onClick={onClose}
        style={{
          position: 'absolute', inset: 0,
          background: 'rgba(20,16,12,0.45)',
          animation: 'mFadeIn 200ms ease-out',
        }}
      />
      {/* panel */}
      <div style={{
        position: 'relative',
        background: p.bg, borderRadius: '24px 24px 0 0',
        height,
        display: 'flex', flexDirection: 'column',
        animation: 'mSlideUp 280ms cubic-bezier(0.32, 0.72, 0, 1)',
        overflow: 'hidden',
      }}>
        {/* grabber */}
        <div style={{ display: 'flex', justifyContent: 'center', padding: '10px 0 4px' }}>
          <div style={{ width: 36, height: 4, borderRadius: 2, background: p.line }}/>
        </div>
        {title && (
          <div style={{
            padding: '8px 20px 16px', borderBottom: `0.5px solid ${p.line}`,
            display: 'flex', alignItems: 'center', justifyContent: 'space-between',
          }}>
            <div style={{ fontFamily: DYRA_MOBILE_TYPE.serif, fontSize: 22, fontWeight: 500, color: p.ink }}>{title}</div>
            <MIconBtn onClick={onClose} label="Close" size={36}>
              <MIco name="close" size={22}/>
            </MIconBtn>
          </div>
        )}
        <div style={{ flex: 1, overflow: 'auto', WebkitOverflowScrolling: 'touch' }}>
          {children}
        </div>
      </div>
      <style>{`
        @keyframes mFadeIn { from { opacity: 0; } to { opacity: 1; } }
        @keyframes mSlideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
      `}</style>
    </div>
  );
}

// ─── Hamburger drawer (slide from right) ─────────────────────────────
function MDrawer({ open, onClose, go, current }) {
  const p = DYRA_MOBILE_PALETTE;
  if (!open) return null;
  const items = [
    { id: 'home',     label: 'Home',           icon: 'home' },
    { id: 'browse',   label: 'Browse homes',   icon: 'search' },
    { id: 'stays',    label: 'My stay',        icon: 'calendar' },
    { id: 'list',     label: 'List your home', icon: 'briefcase' },
    { id: 'help',     label: 'Help & contact', icon: 'phone' },
    { id: 'login',    label: 'Login',          icon: 'shield' },
    { id: 'logout',   label: 'Logout',         icon: 'close'  },
  ];
  return (
    <div style={{ position: 'absolute', inset: 0, zIndex: 200 }}>
      <div onClick={onClose} style={{
        position: 'absolute', inset: 0, background: 'rgba(20,16,12,0.5)',
        animation: 'mFadeIn 180ms',
      }}/>
      <div style={{
        position: 'absolute', top: 0, right: 0, bottom: 0,
        width: '82%', background: p.bg,
        animation: 'mSlideLeft 260ms cubic-bezier(0.32, 0.72, 0, 1)',
        display: 'flex', flexDirection: 'column',
      }}>
        <div style={{
          padding: '16px 20px',
          display: 'flex', alignItems: 'center', justifyContent: 'space-between',
          borderBottom: `0.5px solid ${p.line}`,
        }}>
          <div style={{ display: 'flex', alignItems: 'center', gap: 10 }}>
            <img src={(typeof window !== 'undefined' && window.DYRA_LOGO) || 'assets/dyra-logo.png'}
                 alt="Dyra" style={{ width: 36, height: 36, borderRadius: 6, objectFit: 'cover' }}/>
            <div>
              <div style={{ fontFamily: DYRA_MOBILE_TYPE.serif, fontSize: 18, color: p.ink, fontWeight: 500 }}>Dyra</div>
              <div style={{ fontSize: 9, letterSpacing: '0.18em', textTransform: 'uppercase', color: p.muted }}>Crown Heights</div>
            </div>
          </div>
          <MIconBtn onClick={onClose} label="Close menu"><MIco name="close" size={22}/></MIconBtn>
        </div>
        <div style={{ flex: 1, padding: '8px 8px', overflow: 'auto' }}>
          {items.map(it => {
            const active = current === it.id;
            return (
              <button
                key={it.id}
                onClick={() => {
                  if (it.id === 'login') {
                    // Always force the sign-in form by clearing any stale
                    // Supabase session first, then landing on /admin/login.
                    // The customer-site login button used to skip the form
                    // entirely when a previous admin cookie was still alive.
                    window.location.href = '/auth/logout?next=' + encodeURIComponent('/admin/login');
                  } else if (it.id === 'logout') {
                    // Sign out the current Supabase session and bounce home.
                    window.location.href = '/auth/logout';
                  } else {
                    go(it.id);
                  }
                  onClose();
                }}
                style={{
                  width: '100%', display: 'flex', alignItems: 'center', gap: 14,
                  padding: '14px 14px',
                  background: active ? p.accentSoft : 'transparent',
                  border: 'none', borderRadius: 12,
                  color: active ? p.accentDark : p.ink,
                  fontFamily: DYRA_MOBILE_TYPE.sans, fontSize: 16,
                  textAlign: 'left', cursor: 'pointer',
                  marginBottom: 2,
                  WebkitTapHighlightColor: 'transparent',
                }}
              >
                <MIco name={it.icon} size={22} color={active ? p.accentDark : p.muted}/>
                {it.label}
              </button>
            );
          })}
        </div>
        <div style={{ padding: 20, borderTop: `0.5px solid ${p.line}` }}>
          <div style={{ fontSize: 10, letterSpacing: '0.18em', textTransform: 'uppercase', color: p.muted, marginBottom: 8 }}>Get in touch</div>
          <a href="https://wa.me/18625207797" style={{
            display: 'flex', alignItems: 'center', gap: 10, padding: '10px 0',
            color: p.ink, textDecoration: 'none',
          }}>
            <span style={{
              width: 32, height: 32, borderRadius: 16, background: '#25D366',
              display: 'inline-flex', alignItems: 'center', justifyContent: 'center', color: '#fff',
            }}>
              <MIco name="whatsapp" size={18} color="#fff"/>
            </span>
            <span style={{ fontSize: 14 }}>862-520-7797</span>
          </a>
          <a href="mailto:dyrakosherrentals@gmail.com" style={{
            display: 'flex', alignItems: 'center', gap: 10, padding: '10px 0',
            color: p.ink, textDecoration: 'none',
          }}>
            <span style={{
              width: 32, height: 32, borderRadius: 16, background: '#EA4335',
              display: 'inline-flex', alignItems: 'center', justifyContent: 'center', color: '#fff',
            }}>
              <MIco name="mail" size={16} color="#fff"/>
            </span>
            <span style={{ fontSize: 13 }}>dyrakosherrentals@gmail.com</span>
          </a>
        </div>
      </div>
      <style>{`
        @keyframes mSlideLeft { from { transform: translateX(100%); } to { transform: translateX(0); } }
      `}</style>
    </div>
  );
}

// Export all atoms to window for sibling files
Object.assign(window, {
  DYRA_MOBILE_PALETTE,
  DYRA_MOBILE_TYPE,
  MEyebrow, MIconBtn, MIco, MButton, MAppBar, MTabBar, MSheet, MDrawer,
});
