/* ============================================================
   EventsIQ — Mobile CSS v2
   Square. Fast. Smooth. Premium.
   ============================================================ */

/* ── Performance: font smoothing only (global) ── */
/* IMPORTANT: will-change:transform is NOT applied globally because it creates
   stacking contexts that can trap position:fixed descendants in certain layouts.
   GPU compositing is applied selectively below inside mobile media queries. */
.mobile-app-header,
.btn,
.gc,
.tbl-panel-card,
.event-card {
  -webkit-font-smoothing: antialiased;
}

/* ── Guest List: hide ALL mobile-only UI on desktop ──────────────────────────
   These elements are always in the DOM but must be invisible above 768px.
   The @media (max-width: 768px) block below overrides/shows them on mobile. */
.gl-mobile-only,
.gl-fab,
.gl-sheet-overlay,
.gl-sheet,
.gl-edit-sheet-overlay,
.gl-edit-sheet,
.gl-msg-sheet-overlay,
.gl-msg-sheet {
  display: none !important;
}

/* ── Base mobile ── */
@media (max-width: 768px) {
  html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    text-rendering: optimizeSpeed;
    /* Ensure html is never a containing block for fixed elements */
    transform: none !important;
    will-change: auto !important;
  }
  body {
    /* ═══════════════════════════════════════════════════════
       CRITICAL FIX — position:fixed containing block reset
       ═══════════════════════════════════════════════════════
       dashboard.css sets body { display:flex } which in some browsers
       (especially older Android WebView / Chrome < 80) causes the flex
       container to become the containing block for position:fixed children
       instead of the viewport. Resetting to block is the only safe fix.
       Also clearing transform and will-change on body is essential:
       ANY transform (including translateZ(0)) or will-change:transform on
       an ancestor makes it the containing block for ALL fixed descendants.
    */
    display: block !important;
    transform: none !important;
    will-change: auto !important;
    overscroll-behavior-y: contain;
    /* Push content above the fixed 60px bottom nav + iOS home indicator */
    padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px)) !important;
  }
  body.no-bottom-nav {
    padding-bottom: 0 !important;
  }

  /* .main must be block-level, no flex/grid, no transform, no contain.
     All of these properties create new containing blocks that trap
     position:fixed descendants even after JS teleport. */
  .main {
    display: block !important;
    flex: unset !important;
    margin-left: 0 !important;
    min-height: unset !important;
    width: 100% !important;
    transform: none !important;
    will-change: auto !important;
    contain: none !important;
    overflow: visible !important;
  }

  /* Zero tap highlight — we use custom feedback */
  * { -webkit-tap-highlight-color: transparent; }
  a, button { touch-action: manipulation; }

  /* Square everything globally on mobile */
  *,
  input, select, textarea, button,
  .btn, .card, .fcard, .gc,
  .event-card, .stat-card, .quick-card,
  .add-card, .gtable-wrap, .tbl-panel-card,
  .guest-card, .tbl-card,
  .search-box, .ci-input, .ci-result,
  .tables-card, .tbl-add-row input,
  .install-banner, .install-banner-icon,
  .mah-back, .mah-action,
  .filter-btn, .status-badge,
  .gc-status, .gc-party-badge, .gc-table-badge {
    border-radius: 0 !important;
  }

  /* Content visibility for off-screen sections */
  .events-section { content-visibility: auto; contain-intrinsic-size: 0 400px; }
}

/* ============================================================
   BOTTOM NAVIGATION — Glued to bottom of screen
   ============================================================ */
/* Hidden on desktop; shown via the media query below */
.mobile-bottom-nav { display: none; }

@media (max-width: 768px) {
  .mobile-bottom-nav {
    display: flex !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    /* 60px bar height + iOS home indicator safe area */
    height: calc(60px + env(safe-area-inset-bottom, 0px));
    min-height: 60px;
    background: rgba(8,8,8,.98) !important;
    border-top: 1px solid rgba(255,255,255,.08) !important;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    z-index: 99999 !important;
    align-items: flex-start;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-shadow: 0 -1px 0 rgba(255,255,255,.05), 0 -8px 24px rgba(0,0,0,.4);
    /* GPU compositing for smooth rendering and backdrop-filter support.
       NOTE: transform on the element itself does NOT affect its own
       position:fixed behaviour — only transforms on ANCESTORS matter. */
    transform: translateZ(0) !important;
    -webkit-transform: translateZ(0) !important;
  }

  .mob-nav-item {
    flex: 1;
    height: 60px; /* fixed clickable zone, stays above safe area */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    text-decoration: none;
    color: rgba(255,255,255,.3);
    font-size: .58rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    font-family: 'DM Sans', sans-serif;
    position: relative;
    transition: color .18s ease;
    cursor: pointer;
    border: none;
    background: none;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
  }

  .mob-nav-item svg {
    transition: transform .2s cubic-bezier(.34,1.56,.64,1), opacity .2s;
    opacity: .55;
  }

  .mob-nav-item.active { color: #EA580C; }
  .mob-nav-item.active svg { transform: translateY(-3px); opacity: 1; filter: drop-shadow(0 2px 6px rgba(234,88,12,.55)); }

  .mob-nav-item.active::before {
    content: '';
    position: absolute;
    top: 0; left: 25%; right: 25%;
    height: 2px;
    background: linear-gradient(90deg,#DC2626,#EA580C,#EAB308);
  }

  .mob-nav-item:active { transform: scale(.88); transition: transform .1s; }

  /* FAB check-in button — square version */
  .mob-nav-item.mob-nav-fab {
    background: linear-gradient(135deg,#DC2626,#EA580C,#EAB308);
    color: #fff !important;
    margin: 6px 3px;
    flex: 1.3;
    box-shadow: 0 2px 16px rgba(220,38,38,.4);
    transform: translateZ(0);
  }
  .mob-nav-item.mob-nav-fab::before { display: none; }
  .mob-nav-item.mob-nav-fab svg { opacity: 1; }
  .mob-nav-item.mob-nav-fab.active svg { filter: none; }
  .mob-nav-item.mob-nav-fab:active { transform: scale(.9); }
}

/* ============================================================
   MOBILE APP HEADER
   ============================================================ */
.mobile-app-header { display: none; }

@media (max-width: 768px) {
  .mobile-app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 200;
    padding: 0 1rem;
    height: 52px;
    background: rgba(8,8,8,.97);
    border-bottom: 1px solid rgba(255,255,255,.06);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    transform: translateZ(0);
  }

  .mobile-app-header .mah-logo {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    font-weight: 800;
    background: linear-gradient(135deg,#DC2626,#EA580C,#EAB308);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
  }

  .mobile-app-header .mah-title {
    font-family: 'Playfair Display', serif;
    font-size: .9rem;
    font-weight: 800;
    color: #f0f0f0;
    letter-spacing: .01em;
  }

  .mobile-app-header .mah-back {
    display: flex;
    align-items: center;
    gap: .3rem;
    color: #EA580C;
    font-size: .78rem;
    font-weight: 700;
    font-family: 'DM Sans', sans-serif;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: .5rem .6rem;
    transition: opacity .15s;
  }
  .mobile-app-header .mah-back:active { opacity: .6; }

  .mobile-app-header .mah-action {
    display: flex;
    align-items: center;
    gap: .35rem;
    background: linear-gradient(135deg,#DC2626,#EA580C,#EAB308);
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
    font-family: 'DM Sans', sans-serif;
    text-decoration: none;
    border: none;
    cursor: pointer;
    padding: .45rem .85rem;
    letter-spacing: .04em;
    text-transform: uppercase;
    transition: opacity .15s;
  }
  .mobile-app-header .mah-action:active { opacity: .75; }
}

/* ============================================================
   LANDING PAGE — MOBILE
   ============================================================ */
@media (max-width: 768px) {
  .nav { display: none !important; }

  .mobile-landing-header {
    display: flex !important;
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 500;
    padding: .9rem 1.1rem;
    align-items: center;
    justify-content: space-between;
    background: rgba(8,8,8,.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255,255,255,.06);
  }

  .mobile-landing-header .ml-logo {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    font-weight: 800;
    background: linear-gradient(135deg,#DC2626,#EA580C,#EAB308);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
  }

  .mobile-landing-header .ml-cta {
    background: linear-gradient(135deg,#DC2626,#EA580C,#EAB308);
    color: #fff;
    font-family: 'DM Sans', sans-serif;
    font-size: .75rem;
    font-weight: 700;
    padding: .5rem .95rem;
    text-decoration: none;
    letter-spacing: .04em;
    text-transform: uppercase;
  }

  body.page-landing { padding-top: 56px; }

  .hero { padding: 2.5rem 1.1rem 2rem; min-height: auto; }
  .hero-content { text-align: center; }
  .hero-content h1 { font-size: clamp(2rem, 8vw, 2.8rem); margin-bottom: .75rem; }
  .hero-content p { font-size: .9rem; margin-bottom: 1.5rem; }
  .hero-actions { flex-direction: column; gap: .65rem; }
  .hero-actions .btn { width: 100%; justify-content: center; padding: 1rem 1.5rem; font-size: .95rem; }
  .hero-infographic { display: none; }
  .hero-stats.hero-stats-full { grid-template-columns: 1fr 1fr; gap: .65rem; padding: 1.1rem; margin-top: 1.5rem; }

  .section { padding: 2.5rem 1.1rem; }
  .section-title { font-size: 1.55rem; }

  .steps { grid-template-columns: 1fr; gap: 1rem; }
  .features-grid { grid-template-columns: 1fr; gap: .75rem; }
  .privacy-block { grid-template-columns: 1fr; gap: 2rem; }
  .testimonials-grid { grid-template-columns: 1fr; gap: .75rem; }

  .mobile-landing-header .ml-signin {
    color: rgba(255,255,255,.7);
    font-family: 'DM Sans', sans-serif;
    font-size: .75rem;
    font-weight: 600;
    text-decoration: none;
    padding: .45rem .7rem;
    border: 1px solid rgba(255,255,255,.12);
    transition: color .15s, border-color .15s;
  }
  .mobile-landing-header .ml-signin:active { opacity: .6; }

  /* Hero tighter + stats clean 2-col */
  body.page-landing { padding-top: 56px; }
  .hero { padding: 2rem 1.1rem 1.5rem; min-height: auto; }
  .hero-content { text-align: center; }
  .hero-content h1 { font-size: clamp(1.9rem, 8vw, 2.6rem); margin-bottom: .65rem; line-height: 1.15; }
  .hero-content p { font-size: .875rem; margin-bottom: 1.35rem; color: rgba(255,255,255,.65); line-height: 1.65; }
  .hero-actions { flex-direction: column; gap: .55rem; }
  .hero-actions .btn { width: 100%; justify-content: center; padding: .95rem 1.5rem; font-size: .9rem; }
  .hero-infographic { display: none; }
  .hero-stats.hero-stats-full { grid-template-columns: 1fr 1fr; gap: .55rem; padding: 1rem; margin-top: 1.25rem; }
  .hero-eyebrow { font-size: .7rem; margin-bottom: .85rem; }

  .section { padding: 2.25rem 1.1rem; }
  .section-title { font-size: 1.45rem; }

  .steps { grid-template-columns: 1fr; gap: .85rem; }
  .features-grid { grid-template-columns: 1fr; gap: .65rem; }
  .privacy-block { grid-template-columns: 1fr; gap: 2rem; }
  .testimonials-grid { grid-template-columns: 1fr; gap: .65rem; }

  .cta-block { padding: 2rem 1.1rem; text-align: center; }
  .cta-actions { flex-direction: column; gap: .65rem; }
  .cta-actions .btn { width: 100%; justify-content: center; }

  footer { display: none !important; }

  /* Trust bar compact on mobile */
  .trust-bar { overflow: hidden; }
  .trust-inner { overflow-x: auto; flex-wrap: nowrap; padding: .5rem 0; -webkit-overflow-scrolling: touch; gap: .75rem; scrollbar-width: none; }
  .trust-inner::-webkit-scrollbar { display: none; }
  .trust-item { white-space: nowrap; flex-shrink: 0; font-size: .72rem; }
}

/* ============================================================
   DASHBOARD — MOBILE APP STYLE
   ============================================================ */
@media (max-width: 768px) {
  .sidebar { display: none !important; }
  .main { margin-left: 0 !important; }
  .topbar { display: none !important; }
  .page-body { padding: .9rem .9rem 1.25rem; }

  /* Stats */
  .stats-row { grid-template-columns: 1fr 1fr; gap: .6rem; margin-bottom: 1rem; }
  .stat-card { padding: 1rem; }
  .stat-num { font-size: 1.5rem; }
  .stat-sub { font-size: .68rem; }

  /* Quick Actions — horizontal swipe slider */
  .qa-slider-wrap {
    margin-left: -.9rem;
    margin-right: -.9rem;
    margin-bottom: 1.25rem;
  }
  .quick-row {
    display: flex !important;
    flex-direction: row !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 0 !important;
    background: transparent !important;
    border: none !important;
    padding: 0 .9rem;
    scroll-padding-left: .9rem;
    /* Allow clicks through — don't trap vertical scroll */
    touch-action: pan-x;
  }
  .quick-row::-webkit-scrollbar { display: none; }
  .quick-card {
    flex: 0 0 72vw !important;
    max-width: 260px !important;
    min-width: 0 !important;
    scroll-snap-align: start;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0 !important;
    background: #fff !important;
    border: 1px solid #e5e3de !important;
    border-radius: 0 !important;
    margin-right: .75rem !important;
    padding: 1.1rem 1.15rem !important;
    box-shadow: 0 2px 12px rgba(0,0,0,.07);
    transition: transform .15s, box-shadow .15s;
    text-decoration: none;
  }
  .quick-card:last-child { margin-right: .9rem !important; }
  .quick-card:active { transform: scale(.97); box-shadow: 0 1px 6px rgba(0,0,0,.1); }
  .quick-icon {
    width: 42px !important;
    height: 42px !important;
    border-radius: 0 !important;
    background: rgba(234,88,12,.08) !important;
    border: 1px solid rgba(234,88,12,.15) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #EA580C;
    margin-bottom: .75rem;
    flex-shrink: 0;
  }
  .quick-title { font-size: .9rem; font-weight: 700; margin-bottom: .2rem; }
  .quick-sub   { font-size: .78rem; line-height: 1.45; }

  /* Scroll dots */
  .qa-dots {
    display: flex !important;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: .75rem;
  }
  .qa-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #e5e3de;
    transition: width .25s, background .25s;
    cursor: pointer;
    border: none;
  }
  .qa-dot.active {
    width: 20px;
    border-radius: 0;
    background: #EA580C;
  }

  /* Events */
  .events-grid { grid-template-columns: 1fr; gap: .75rem; }
  .event-card { padding: 1.1rem; }
  .event-card-top h3 { font-size: .92rem; }
  .event-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-top: .85rem; }
  .event-actions .btn { width: 100%; text-align: center; padding: .65rem .5rem; font-size: .75rem; }
  .event-actions .btn.btn-fire { grid-column: 1 / -1; padding: .75rem; font-size: .82rem; }
  .section-hd { flex-direction: column; align-items: flex-start; gap: .6rem; }
}

/* ============================================================
   CREATE / EDIT EVENT — MOBILE
   ============================================================ */
@media (max-width: 768px) {
  .page-inner { grid-template-columns: 1fr !important; gap: .75rem; }
  .summary { display: none; }
  .steps-header { flex-direction: row; overflow-x: auto; gap: 0; margin-bottom: 1rem; }
  .step-item { padding: .75rem 1rem; min-width: 90px; flex-shrink: 0; }
  .fcard { margin-bottom: .65rem; }
  .fcard-head { padding: 1.1rem 1.1rem 0; }
  .fcard-body { padding: 0 1.1rem 1.1rem; }
  .field-row { grid-template-columns: 1fr; gap: .65rem; }
  .cat-pills { grid-template-columns: 1fr 1fr 1fr; gap: .4rem; }
  .cpill { padding: .6rem .3rem; font-size: .72rem; }
  .fee-display { flex-direction: column; gap: .65rem; }
  .alert-info { font-size: .78rem; }
  .form-foot { flex-direction: column-reverse; gap: .6rem; }
  .form-foot .btn { width: 100%; justify-content: center; }
  /* Prevent iOS zoom on input focus */
  .field input, .field select, .field textarea { font-size: 16px; }
  .status-row { gap: .4rem; }
  .spill { padding: .5rem .8rem; font-size: .75rem; }
}

/* ============================================================
   INVITEES / GUEST LIST — MOBILE APP DESIGN (v3 Complete)
   ============================================================ */

/* ── Hide desktop elements on mobile ── */
@media (max-width: 768px) {
  /* Hide desktop table container — replaced by mobile cards */
  .gl-desktop-only { display: none !important; }
  /* Show mobile-only elements */
  .gl-mobile-only  { display: block !important; }

  /* Prevent horizontal overflow globally on this page */
  .page-body { padding: 0 !important; }

  .event-selector { display: none !important; }

  /* ── Mobile Event Selector Banner ── */
  .gl-event-banner {
    display: flex !important;
    align-items: center;
    gap: .65rem;
    background: #fff;
    border-bottom: 1px solid #e8e4dd;
    padding: .7rem 1rem;
    position: sticky;
    top: 52px; /* height of mobile-app-header */
    z-index: 150;
  }
  .gl-event-banner-icon {
    width: 32px; height: 32px; flex-shrink: 0;
    background: rgba(234,88,12,.08);
    border: 1px solid rgba(234,88,12,.18);
    display: flex; align-items: center; justify-content: center;
    color: #EA580C;
  }
  .gl-event-banner select {
    border: none;
    background: transparent;
    font-family: 'DM Sans', sans-serif;
    font-size: .88rem;
    font-weight: 700;
    color: #18181b;
    outline: none;
    flex: 1;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    padding-right: 1.25rem;
    font-size: 16px; /* prevent iOS zoom */
  }
  .gl-event-banner-chevron { flex-shrink: 0; color: #9ca3af; pointer-events: none; }

  /* ── Mobile Stats Strip ── */
  .gl-stats-strip {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr);
    background: #fff;
    border-bottom: 1px solid #e8e4dd;
    gap: 0;
  }
  .gl-stat-cell {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: .9rem .5rem;
    position: relative;
  }
  .gl-stat-cell:not(:last-child)::after {
    content: '';
    position: absolute; right: 0; top: 20%; bottom: 20%;
    width: 1px; background: #e8e4dd;
  }
  .gl-stat-val {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem; font-weight: 900;
    color: #18181b; line-height: 1;
  }
  .gl-stat-val.fire {
    background: linear-gradient(135deg,#DC2626,#EA580C,#EAB308);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
  }
  .gl-stat-lbl {
    font-size: .62rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .07em;
    color: #9ca3af; margin-top: .25rem;
  }

  /* ── Mobile Sticky Search + Filter Bar ── */
  .gl-search-bar {
    display: flex !important;
    align-items: center;
    gap: 0;
    background: #f8f6f1;
    border-bottom: 1px solid #e8e4dd;
    position: sticky;
    top: calc(52px + 44px); /* header + event banner */
    z-index: 140;
    padding: .6rem .9rem;
    gap: .5rem;
  }
  .gl-search-input-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    gap: .5rem;
    background: #fff;
    border: 1.5px solid #e8e4dd;
    padding: .55rem .85rem;
    transition: border-color .2s;
  }
  .gl-search-input-wrap:focus-within { border-color: #EA580C; }
  .gl-search-input-wrap input {
    border: none; background: transparent; outline: none;
    font-family: 'DM Sans', sans-serif;
    font-size: 16px; /* prevent iOS zoom */
    color: #18181b; width: 100%;
  }
  .gl-search-input-wrap input::placeholder { color: #bbb; }
  .gl-search-icon { color: #9ca3af; flex-shrink: 0; }

  /* ── Mobile Filter Pills ── */
  .gl-filter-pills {
    display: flex !important;
    gap: .35rem;
    overflow-x: auto;
    scrollbar-width: none;
    background: #f8f6f1;
    padding: 0 .9rem .65rem;
    border-bottom: 1px solid #e8e4dd;
  }
  .gl-filter-pills::-webkit-scrollbar { display: none; }
  .gl-filter-pill {
    flex-shrink: 0;
    padding: .4rem .85rem;
    font-family: 'DM Sans', sans-serif;
    font-size: .75rem; font-weight: 700;
    border: 1.5px solid #e0ddd5;
    background: #fff;
    color: #6b6b6b;
    cursor: pointer;
    transition: all .18s;
    white-space: nowrap;
    letter-spacing: .03em;
  }
  .gl-filter-pill.active {
    background: #EA580C;
    border-color: #EA580C;
    color: #fff;
  }

  /* ── Mobile Guest List Container ── */
  .gl-mobile-list {
    padding: .75rem .9rem;
    display: flex;
    flex-direction: column;
    gap: .6rem;
    /* Extra padding for FAB + bottom nav */
    padding-bottom: calc(80px + 60px + env(safe-area-inset-bottom,0px));
  }

  /* ── Mobile Guest Card ── */
  .mgc {
    background: #fff;
    border: 1px solid #e8e4dd;
    border-left: 3px solid #EA580C;
    position: relative;
    overflow: hidden;
    transition: box-shadow .18s, border-left-color .18s;
    -webkit-tap-highlight-color: transparent;
  }
  .mgc.mgc--checked { border-left-color: #22c55e; }
  .mgc.mgc--checked { background: #fafffe; }
  .mgc:active { transform: scale(.99); transition: transform .08s; }

  .mgc-inner {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .85rem .9rem .8rem;
  }

  /* Avatar */
  .mgc-avatar {
    width: 40px; height: 40px; flex-shrink: 0;
    background: linear-gradient(135deg,#DC2626,#EA580C,#EAB308);
    display: flex; align-items: center; justify-content: center;
    font-family: 'Playfair Display', serif;
    font-size: .82rem; font-weight: 800; color: #fff;
    letter-spacing: .02em;
  }
  .mgc-avatar.no-name {
    background: linear-gradient(135deg,#6366f1,#8b5cf6);
  }
  .mgc-avatar.is-checked {
    background: linear-gradient(135deg,#16a34a,#22c55e);
  }

  /* Content area */
  .mgc-content { flex: 1; min-width: 0; }
  .mgc-top-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .5rem;
    margin-bottom: .3rem;
  }
  .mgc-name {
    font-family: 'DM Sans', sans-serif;
    font-size: .9rem; font-weight: 700;
    color: #18181b; line-height: 1.3;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: 180px;
  }
  .mgc-name.no-name { color: #9ca3af; font-style: italic; font-weight: 400; }
  .mgc-status-badge {
    flex-shrink: 0;
    display: inline-flex; align-items: center; gap: .25rem;
    font-size: .65rem; font-weight: 700;
    padding: .2rem .55rem;
    white-space: nowrap;
    letter-spacing: .04em;
  }
  .mgc-status-badge.pending {
    background: #fef3c7; color: #92400e;
    border: 1px solid rgba(146,64,14,.15);
  }
  .mgc-status-badge.checked {
    background: #dcfce7; color: #15803d;
    border: 1px solid rgba(21,128,61,.15);
  }

  /* Phone + meta row */
  .mgc-meta {
    display: flex; align-items: center;
    flex-wrap: wrap; gap: .3rem .65rem;
    margin-bottom: .4rem;
  }
  .mgc-phone {
    font-family: monospace;
    font-size: .8rem; color: #4b5563;
    display: flex; align-items: center; gap: .3rem;
  }
  .mgc-email {
    font-size: .75rem; color: #6366f1;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: 160px;
    display: flex; align-items: center; gap: .25rem;
  }
  .mgc-note {
    font-size: .73rem; color: #9ca3af;
    font-style: italic;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: 200px;
  }

  /* Tags row */
  .mgc-tags {
    display: flex; align-items: center; gap: .3rem;
    flex-wrap: nowrap; overflow: hidden;
  }
  .mgc-table-tag {
    display: inline-flex; align-items: center; gap: .25rem;
    background: rgba(99,102,241,.07);
    color: #6366f1;
    border: 1px solid rgba(99,102,241,.18);
    font-size: .65rem; font-weight: 700;
    padding: .18rem .45rem;
    white-space: nowrap;
  }
  .mgc-party-tag {
    display: inline-flex; align-items: center; gap: .2rem;
    background: rgba(234,88,12,.07);
    color: #EA580C;
    border: 1px solid rgba(234,88,12,.18);
    font-size: .65rem; font-weight: 700;
    padding: .18rem .45rem;
    white-space: nowrap;
  }
  .mgc-date-tag {
    font-size: .65rem; color: #c0bbb4;
    margin-left: auto; white-space: nowrap;
    flex-shrink: 0;
  }

  /* ── Action Row — shown at bottom of each card ── */
  .mgc-actions {
    display: flex;
    align-items: stretch;
    border-top: 1px solid #f0ede8;
  }
  .mgc-action-btn {
    flex: 1;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: .25rem;
    padding: .55rem .25rem;
    border: none; background: none;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    font-size: .6rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .06em;
    color: #9ca3af;
    text-decoration: none;
    position: relative;
    transition: color .15s, background .15s;
    -webkit-tap-highlight-color: transparent;
  }
  .mgc-action-btn:not(:last-child)::after {
    content: '';
    position: absolute; right: 0; top: 20%; bottom: 20%;
    width: 1px; background: #f0ede8;
  }
  .mgc-action-btn:active { background: #faf9f7; }
  .mgc-action-btn.checkin-btn { color: #16a34a; }
  .mgc-action-btn.checkin-btn:active { background: rgba(22,163,74,.06); }
  .mgc-action-btn.msg-btn    { color: #6366f1; }
  .mgc-action-btn.msg-btn:active { background: rgba(99,102,241,.06); }
  .mgc-action-btn.edit-btn   { color: #EA580C; }
  .mgc-action-btn.edit-btn:active { background: rgba(234,88,12,.06); }
  .mgc-action-btn.del-btn    { color: #ef4444; }
  .mgc-action-btn.del-btn:active { background: rgba(239,68,68,.06); }

  .mgc-empty {
    padding: 3rem 1.5rem;
    text-align: center;
    color: #9ca3af;
    font-size: .875rem;
  }
  .mgc-empty-icon {
    width: 64px; height: 64px; margin: 0 auto 1rem;
    background: #f8f6f1;
    border: 1px solid #e8e4dd;
    display: flex; align-items: center; justify-content: center;
    color: #c0bbb4;
  }
  .mgc-empty h3 { font-size: .95rem; color: #4b5563; margin-bottom: .4rem; }

  /* ── Section header for mobile ── */
  .gl-section-hd {
    display: flex; align-items: center;
    justify-content: space-between;
    padding: .75rem .9rem .35rem;
  }
  .gl-section-hd h3 {
    font-size: .78rem; font-weight: 800;
    text-transform: uppercase; letter-spacing: .08em;
    color: #9ca3af;
  }
  .gl-section-hd .gl-count-badge {
    font-size: .7rem; font-weight: 700;
    background: rgba(234,88,12,.08); color: #EA580C;
    border: 1px solid rgba(234,88,12,.18);
    padding: .18rem .55rem;
  }

  /* ── Floating Add Guest Button (FAB) ── */
  .gl-fab {
    position: fixed !important;
    right: 1rem;
    bottom: calc(60px + env(safe-area-inset-bottom,0px) + .85rem);
    z-index: 1500;
    display: flex !important;
    align-items: center; gap: .5rem;
    background: #0a0a0a;
    color: #fff !important;
    border: none !important;
    padding: .85rem 1.35rem;
    font-family: 'DM Sans', sans-serif;
    font-size: .82rem; font-weight: 800;
    text-transform: uppercase; letter-spacing: .06em;
    box-shadow: 0 4px 24px rgba(0,0,0,.35), 0 2px 8px rgba(0,0,0,.15);
    cursor: pointer;
    text-decoration: none;
    transition: opacity .15s, transform .15s;
    -webkit-tap-highlight-color: transparent;
  }
  .gl-fab:active { opacity: .85; transform: scale(.96); }

  /* ── Add Guest Bottom Sheet ── */
  .gl-sheet-overlay {
    display: block !important;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 9000;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    opacity: 0; pointer-events: none; visibility: hidden;
    transition: opacity .25s, visibility .25s;
  }
  .gl-sheet-overlay.open {
    opacity: 1; pointer-events: auto; visibility: visible;
  }
  .gl-sheet {
    display: flex !important; flex-direction: column;
    position: fixed;
    left: 0; right: 0;
    bottom: calc(60px + env(safe-area-inset-bottom, 0px));
    z-index: 9010;
    background: #fff;
    border-top-left-radius: 20px; border-top-right-radius: 20px;
    transform: translateY(100%);
    transition: transform .32s cubic-bezier(.4,0,.2,1);
    max-height: calc(92vh - 60px - env(safe-area-inset-bottom, 0px));
  }
  .gl-sheet.open { transform: translateY(0); }

  .gl-sheet-handle {
    width: 40px; height: 4px;
    background: #d4d1cc;
    border-radius: 2px;
    margin: 10px auto 0;
    flex-shrink: 0;
  }
  .gl-sheet-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1rem 1.25rem .85rem;
    border-bottom: 1px solid #e8e4dd;
    flex-shrink: 0;
  }
  .gl-sheet-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem; font-weight: 800; font-style: italic;
    color: #18181b;
  }
  .gl-sheet-close {
    width: 34px; height: 34px;
    background: #f0ede8; border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: #9ca3af;
    border-radius: 50%;
    -webkit-tap-highlight-color: transparent;
  }
  .gl-sheet-close:active { background: #e5e3de; }
  .gl-sheet-body {
    overflow-y: auto; flex: 1;
    padding: 1.1rem 1.25rem 1.25rem;
    -webkit-overflow-scrolling: touch;
  }
  .gl-sheet-field {
    margin-bottom: 1rem;
  }
  .gl-sheet-field:last-child { margin-bottom: 0; }
  .gl-sheet-field label {
    display: block;
    font-size: .72rem; font-weight: 700;
    color: #18181b; margin-bottom: .4rem;
    text-transform: uppercase; letter-spacing: .07em;
  }
  .gl-sheet-field label span {
    font-weight: 400; color: #9ca3af;
    text-transform: none; letter-spacing: 0;
  }
  .gl-sheet-field input,
  .gl-sheet-field select,
  .gl-sheet-field textarea {
    width: 100%;
    padding: .85rem 1rem;
    border: 1.5px solid #e5e3de;
    background: #f8f6f3;
    color: #18181b;
    font-family: 'DM Sans', sans-serif;
    font-size: 16px; /* prevent iOS zoom */
    outline: none;
    transition: border-color .18s, background .18s, box-shadow .18s;
    -webkit-appearance: none; appearance: none;
    resize: none;
    border-radius: 0;
  }
  .gl-sheet-field select {
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
  }
  .gl-sheet-field input:focus,
  .gl-sheet-field select:focus,
  .gl-sheet-field textarea:focus {
    border-color: #EA580C;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(234,88,12,.08);
  }
  .gl-sheet-field input::placeholder { color: #bbb; }
  .gl-sheet-field input[type=number] { -moz-appearance: textfield; }

  /* Email field accent */
  .gl-sheet-field input[type=email] {
    border-left: 3px solid #6366f1;
  }
  .gl-sheet-field input[type=email]:focus {
    border-left-color: #6366f1;
  }

  .gl-sheet-invite-row {
    display: none;
    margin: -.25rem 0 1rem;
    padding: .85rem 1rem;
    background: rgba(99,102,241,.04);
    border: 1px solid rgba(99,102,241,.15);
  }
  .gl-sheet-invite-row.show { display: flex; align-items: flex-start; gap: .7rem; }
  .gl-sheet-invite-row input[type=checkbox] {
    width: 20px; height: 20px; flex-shrink: 0; margin-top: 2px;
    accent-color: #EA580C; cursor: pointer;
  }
  .gl-sheet-invite-label { font-size: .84rem; font-weight: 600; color: #18181b; line-height: 1.45; }
  .gl-sheet-invite-sub { display: block; font-size: .72rem; color: #9ca3af; font-weight: 400; margin-top: .15rem; }

  .gl-sheet-footer {
    padding: 1rem 1.25rem calc(env(safe-area-inset-bottom, 0px) + .75rem);
    border-top: 1px solid #e8e4dd;
    display: flex; flex-direction: column; gap: .55rem;
    flex-shrink: 0;
    background: #fff;
  }
  .gl-sheet-submit {
    width: 100%; padding: 1rem;
    background: #0a0a0a;
    color: #fff; border: none; cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    font-size: .88rem; font-weight: 800;
    text-transform: uppercase; letter-spacing: .07em;
    transition: opacity .18s;
    display: flex; align-items: center; justify-content: center; gap: .5rem;
    -webkit-tap-highlight-color: transparent;
  }
  .gl-sheet-submit:active { opacity: .82; }
  .gl-sheet-submit:disabled { opacity: .4; pointer-events: none; }

  /* ── Tables Bottom Sheet ── */
  .gl-tables-toggle-btn {
    display: flex !important;
    width: 100%;
    align-items: center; justify-content: space-between;
    padding: .8rem .9rem;
    background: #fff;
    border: none;
    border-top: 1px solid #e8e4dd;
    border-bottom: 1px solid #e8e4dd;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    margin: .5rem 0;
  }
  .gl-tables-toggle-btn-left {
    display: flex; align-items: center; gap: .6rem;
    font-family: 'DM Sans', sans-serif;
    font-size: .85rem; font-weight: 700; color: #18181b;
  }
  .gl-tables-toggle-icon {
    width: 32px; height: 32px;
    background: rgba(99,102,241,.07);
    border: 1px solid rgba(99,102,241,.15);
    display: flex; align-items: center; justify-content: center;
    color: #6366f1;
  }
  .gl-tables-panel {
    display: none;
    background: #fff;
    border-bottom: 1px solid #e8e4dd;
    padding: .75rem .9rem 1rem;
  }
  .gl-tables-panel.open { display: block; }
  .gl-tbl-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .5rem;
    margin-bottom: .75rem;
  }
  .gl-tbl-card {
    border: 1.5px solid #e8e4dd;
    padding: .7rem .85rem;
    display: flex; flex-direction: column; gap: .3rem;
    position: relative;
  }
  .gl-tbl-card::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg,#6366f1,#8b5cf6);
  }
  .gl-tbl-name { font-size: .82rem; font-weight: 700; color: #18181b; }
  .gl-tbl-count { font-size: .7rem; color: #9ca3af; }
  .gl-tbl-del {
    position: absolute; top: .4rem; right: .4rem;
    background: none; border: none;
    color: #d1d5db; cursor: pointer; padding: .2rem;
    line-height: 1; transition: color .15s;
  }
  .gl-tbl-del:active { color: #ef4444; }
  .gl-tbl-add-row {
    display: flex; gap: .5rem;
  }
  .gl-tbl-add-row input {
    flex: 1;
    padding: .65rem .75rem;
    border: 1.5px solid #e8e4dd;
    font-family: 'DM Sans', sans-serif;
    font-size: 16px;
    background: #faf9f6;
    color: #18181b; outline: none;
    transition: border-color .2s;
  }
  .gl-tbl-add-row input:focus { border-color: #EA580C; }
  .gl-tbl-add-btn {
    padding: .65rem 1rem;
    background: #0a0a0a;
    color: #fff; border: none; cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    font-size: .8rem; font-weight: 700;
    white-space: nowrap; transition: opacity .18s;
  }
  .gl-tbl-add-btn:active { opacity: .82; }

  /* ── Mobile Quick Actions bar (Export + Print) ── */
  .gl-quick-actions {
    display: flex !important;
    gap: .5rem;
    padding: .65rem .9rem;
    background: #f8f6f1;
    border-bottom: 1px solid #e8e4dd;
    overflow-x: auto; scrollbar-width: none;
  }
  .gl-quick-actions::-webkit-scrollbar { display: none; }
  .gl-quick-btn {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .5rem .9rem;
    border: 1.5px solid #e0ddd5;
    background: #fff;
    font-family: 'DM Sans', sans-serif;
    font-size: .75rem; font-weight: 700;
    color: #4b5563;
    white-space: nowrap; cursor: pointer;
    text-decoration: none;
    transition: border-color .18s, color .18s;
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
  }
  .gl-quick-btn:active { border-color: #EA580C; color: #EA580C; background: rgba(234,88,12,.04); }

  /* ── Edit Guest Sheet ── */
  .gl-edit-sheet-overlay {
    display: block !important;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 9020;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    opacity: 0; pointer-events: none; visibility: hidden;
    transition: opacity .25s, visibility .25s;
  }
  .gl-edit-sheet-overlay.open {
    opacity: 1; pointer-events: auto; visibility: visible;
  }
  .gl-edit-sheet {
    display: flex !important; flex-direction: column;
    position: fixed;
    left: 0; right: 0;
    bottom: calc(60px + env(safe-area-inset-bottom, 0px));
    z-index: 9030;
    background: #fff;
    border-top-left-radius: 20px; border-top-right-radius: 20px;
    transform: translateY(100%);
    transition: transform .32s cubic-bezier(.4,0,.2,1);
    max-height: calc(92vh - 60px - env(safe-area-inset-bottom, 0px));
  }
  .gl-edit-sheet.open { transform: translateY(0); }

  /* ── Message Sheet ── */
  .gl-msg-sheet-overlay {
    display: block !important;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 9040;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    opacity: 0; pointer-events: none; visibility: hidden;
    transition: opacity .25s, visibility .25s;
  }
  .gl-msg-sheet-overlay.open {
    opacity: 1; pointer-events: auto; visibility: visible;
  }
  .gl-msg-sheet {
    display: flex !important; flex-direction: column;
    position: fixed;
    left: 0; right: 0;
    bottom: calc(60px + env(safe-area-inset-bottom, 0px));
    z-index: 9050;
    background: #fff;
    border-top-left-radius: 20px; border-top-right-radius: 20px;
    transform: translateY(100%);
    transition: transform .32s cubic-bezier(.4,0,.2,1);
    max-height: calc(70vh - 60px - env(safe-area-inset-bottom, 0px));
  }
  .gl-msg-sheet.open { transform: translateY(0); }

  /* Hide desktop layout blocks (old + redesigned class names) */
  .page-cols    { display: block !important; }
  .add-card     { display: none !important; }
  .tables-card  { display: none !important; }
  .gtable-wrap  { display: none !important; }
  .toolbar      { display: none !important; }
  .guest-stats  { display: none !important; }
  .event-selector { display: none !important; }
  .inv-layout   { display: none !important; }
  .inv-stats    { display: none !important; }
  .ev-sel       { display: none !important; }
  .inv-toolbar  { display: none !important; }
  .inv-table-card { display: none !important; }
  .inv-panel    { display: none !important; }
  .topbar       { display: none !important; }
  .pass-cta     { display: none !important; }
}

/* ============================================================
   EVENT DETAIL — MOBILE
   ============================================================ */
@media (max-width: 768px) {
  .detail-grid { grid-template-columns: 1fr !important; }
  .panel-sticky { position: static !important; }
  .stat-row { grid-template-columns: 1fr 1fr 1fr; gap: 0; }
  .stat-cell { padding: 1rem .75rem; }
  .stat-num { font-size: 1.5rem; }
  .tbl-card-grid { grid-template-columns: 1fr 1fr !important; gap: .6rem; }
  .tbl-card { padding: 1rem; }
  .tbl-card-nums { margin-bottom: .6rem; }
  .action-btn { padding: .75rem 1rem; font-size: .8rem; }
  .card-body { padding: 1rem; }
  .card-head { padding: .85rem 1rem; }
  .recent-item { padding: .6rem .75rem; }
}

/* ============================================================
   CHECK-IN — MOBILE
   ============================================================ */
@media (max-width: 768px) {
  .checkin-wrap { grid-template-columns: 1fr !important; }
  .ci-panel { display: none !important; }
  /* Extra bottom padding so content clears the fixed bottom nav */
  .checkin-main {
    padding: 1rem 1rem calc(80px + env(safe-area-inset-bottom, 0px));
    min-height: 100vh;
  }
  .top-bar { display: none; }
  .ci-heading { font-size: clamp(1.6rem, 7vw, 2.4rem); }
  .ci-sub { font-size: .86rem; margin-bottom: 1.5rem; }
  .ci-input-wrap { flex-direction: column; gap: .6rem; }
  .ci-input { font-size: 16px; padding: 1rem 1.1rem; }
  .ci-btn { width: 100%; padding: 1rem; font-size: .95rem; }
  .ci-result { padding: 1.1rem; }
  .act-item { padding: .55rem .8rem; }
  .checkin-event-panel { padding: .9rem 1rem; }
  .event-select-bar { padding: .65rem .9rem; }
  .event-select-bar select { font-size: 15px; }
}

/* ============================================================
   CHECK-IN SUCCESS — MOBILE
   ============================================================ */
@media (max-width: 768px) {
  .success-wrap { padding: 5rem 1rem 1.5rem; max-width: 100%; }
  .guest-card { padding: 1.25rem 1rem; }
  .gc-row { padding: .7rem 0; font-size: .85rem; }
  .success-actions { flex-direction: column; gap: .6rem; }
  .success-actions .btn { width: 100%; text-align: center; }
}

/* ============================================================
   SIGNUP / LOGIN / CONFIRMATION — MOBILE
   ============================================================ */
@media (max-width: 768px) {
  .wrap { grid-template-columns: 1fr; min-height: 100vh; }
  .left { display: none !important; }
  .right { padding: 4.5rem 1.25rem 2rem; overflow-y: auto; min-height: 100vh; }
  .right::before { display: none; }
  .fg input, .fg select { font-size: 16px; padding: .9rem 1rem; }
  .row { grid-template-columns: 1fr; }
  h1 { font-size: 1.55rem; }
  .signup-mobile-header { display: flex !important; }
  .conf-wrap { grid-template-columns: 1fr; }
  .conf-left { display: none !important; }
  .conf-right { padding: 4.5rem 1.25rem 2rem; }
  .perks { grid-template-columns: 1fr; gap: .4rem; }
}

/* ============================================================
   ADMIN — MOBILE
   ============================================================ */
@media (max-width: 768px) {
  .admin-wrap { grid-template-columns: 1fr; }
  .admin-side { display: none; }
  .admin-topbar { padding: .8rem .9rem; }
  .admin-content { padding: .9rem; }
  .data-table-wrap { overflow: hidden; }
  .data-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-toolbar { padding: .65rem .9rem; }
  .tb-search { font-size: 16px; }
}

/* ============================================================
   INSTALL BANNER
   ============================================================ */
.install-banner {
  display: none;
  position: fixed;
  bottom: 68px;
  left: 0; right: 0;
  background: #111;
  border: 1px solid rgba(234,88,12,.25);
  border-top: 2px solid #EA580C;
  padding: 1rem 1.1rem;
  z-index: 9998;
  flex-direction: column;
  gap: .65rem;
  box-shadow: 0 -4px 24px rgba(0,0,0,.4);
  animation: slideUpBanner .25s ease;
}
@keyframes slideUpBanner {
  from { transform: translateY(16px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
@media (max-width: 768px) { .install-banner.show { display: flex; } }
.install-banner-content { display: flex; align-items: center; gap: .75rem; }
.install-banner-icon {
  width: 42px; height: 42px;
  background: linear-gradient(135deg,#DC2626,#EA580C,#EAB308);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Playfair Display',serif; font-weight: 900; font-size: .88rem; color: #fff;
  flex-shrink: 0;
}
.install-banner-text strong { display: block; font-size: .86rem; color: #f0f0f0; margin-bottom: .1rem; }
.install-banner-text span { font-size: .73rem; color: #777; }
.install-banner-actions { display: flex; gap: .5rem; }
.install-btn { flex: 1; padding: .6rem; font-family: 'DM Sans',sans-serif; font-size: .78rem; font-weight: 700; border: none; cursor: pointer; text-align: center; text-transform: uppercase; letter-spacing: .04em; }
.install-btn-primary { background: linear-gradient(135deg,#DC2626,#EA580C,#EAB308); color: #fff; }
.install-btn-dismiss { background: rgba(255,255,255,.05); color: #666; border: 1px solid rgba(255,255,255,.08); }

/* ============================================================
   SLIDE DRAWER — Swipe-up More menu
   ============================================================ */
.mob-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 99990;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
  visibility: hidden;
}
.mob-drawer-overlay.show {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}
.mob-drawer {
  position: fixed;
  left: 0; right: 0;
  bottom: 0;
  z-index: 99995;
  background: #0e0e12;
  border-top: 1px solid rgba(255,255,255,.09);
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
  padding-bottom: calc(env(safe-area-inset-bottom,0px) + 8px);
  transform: translateY(100%);
  transition: transform .32s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 -8px 40px rgba(0,0,0,.5);
  will-change: transform;
  visibility: hidden;
}
.mob-drawer.open {
  transform: translateY(0);
  visibility: visible;
}
.mob-drawer-handle {
  width: 36px; height: 4px;
  background: rgba(255,255,255,.15);
  border-radius: 2px;
  margin: 10px auto 0;
}
.mob-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .85rem 1.25rem .5rem;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.mob-drawer-title {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  font-weight: 900;
  font-style: italic;
  background: linear-gradient(135deg,#DC2626,#EA580C,#EAB308);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.mob-drawer-close {
  background: rgba(255,255,255,.06);
  border: none;
  color: #9ca3af;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  border-radius: 50%;
  transition: background .15s;
}
.mob-drawer-close:active { background: rgba(255,255,255,.12); }
.mob-drawer-nav {
  padding: .5rem 0;
}
.mob-drawer-section-label {
  font-size: .6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: #52526a;
  padding: .65rem 1.25rem .25rem;
}
.mob-drawer-item {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .85rem 1.25rem;
  color: rgba(255,255,255,.75);
  text-decoration: none;
  font-family: 'DM Sans', sans-serif;
  font-size: .9rem;
  font-weight: 600;
  border: none;
  background: none;
  width: 100%;
  cursor: pointer;
  transition: background .15s, color .15s;
  position: relative;
}
.mob-drawer-item:active { background: rgba(255,255,255,.04); }
.mob-drawer-item.active { color: #EA580C; }
.mob-drawer-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 20%; bottom: 20%;
  width: 3px;
  background: linear-gradient(180deg,#DC2626,#EA580C);
}
.mdi-icon {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.05);
  border-radius: 8px;
  flex-shrink: 0;
  color: #EA580C;
}
.mob-drawer-item.active .mdi-icon {
  background: rgba(234,88,12,.12);
}
.mob-drawer-badge {
  margin-left: auto;
  font-size: .6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: .18rem .5rem;
  background: rgba(234,88,12,.1);
  color: #EA580C;
  border: 1px solid rgba(234,88,12,.2);
}

/* Light theme drawer */
body.page-light .mob-drawer {
  background: #faf9f6;
  border-top: 1px solid #e0ddd5;
  box-shadow: 0 -8px 40px rgba(0,0,0,.12);
}
body.page-light .mob-drawer-title { -webkit-text-fill-color: transparent; }
body.page-light .mob-drawer-handle { background: rgba(0,0,0,.12); }
body.page-light .mob-drawer-header { border-bottom-color: #e0ddd5; }
body.page-light .mob-drawer-close { background: rgba(0,0,0,.05); color: #9ca3af; }
body.page-light .mob-drawer-section-label { color: #b0a99a; }
body.page-light .mob-drawer-item { color: #18181b; }
body.page-light .mdi-icon { background: rgba(0,0,0,.04); }

/* ============================================================
   PAGE TRANSITIONS & TOUCH FEEDBACK
   ============================================================ */
@media (max-width: 768px) {
  /* ── Page fade-in on load ──────────────────────────────────────────────
     IMPORTANT: We use opacity-ONLY animation here. The previous version used
     transform:translateY() which — with fill-mode:both — permanently applies
     transform:translateY(0) to .main as a CSS active value. Any active
     transform (even identity) makes that element a containing block for ALL
     position:fixed descendants. This permanently trapped the mobile nav
     before the JS teleport could run.
  ── */
  .main, .success-wrap, .checkin-main, .right {
    animation: pageSlideIn .25s ease both;
  }
  @keyframes pageSlideIn {
    from { opacity: 0; }
    to   { opacity: 1; }
  }

  /* Touch press feedback */
  .btn:active, .event-card:active, .quick-card:active,
  .gc:active, .tbl-panel-card:active, .tbl-card:active {
    transform: scale(.975);
    transition: transform .08s ease;
  }
  .mob-nav-item:active { transform: scale(.88); }

  /* Smooth scroll momentum on card grids */
  .guest-card-grid, .tbl-panel-grid, .tbl-card-grid, .events-grid {
    -webkit-overflow-scrolling: touch;
  }
}

/* ============================================================
   LIGHT THEME MOBILE OVERRIDES
   ============================================================ */
@media (max-width: 768px) {
  body.page-light .mobile-bottom-nav {
    background: rgba(250,249,246,.99) !important;
    border-top: 1px solid #e0ddd5 !important;
    box-shadow: 0 -1px 0 #e0ddd5, 0 -6px 20px rgba(0,0,0,.06);
  }
  body.page-light .mob-nav-item { color: #c0bbaf; }
  body.page-light .mob-nav-item.active { color: #EA580C; }
  body.page-light .mobile-app-header {
    background: rgba(250,249,246,.98) !important;
    border-bottom: 1px solid #e0ddd5 !important;
  }
  body.page-light .mah-title { color: #18181b; }
  body.page-light .mah-back { color: #EA580C; }
}

/* ── Event Card Component (Brand-Coloured, Square, Premium) ── */
:root {
  --brand-red:    #DC2626;
  --brand-orange: #EA580C;
  --brand-gold:   #EAB308;
  --brand-grad:   linear-gradient(135deg, #DC2626, #EA580C, #EAB308);
  --brand-grad-h: linear-gradient(90deg, #DC2626, #EA580C);
}
.ec {
  background: #fff;
  border: 1px solid #ede8e2;
  border-left: 3px solid var(--brand-orange);
  margin-bottom: 1.25rem;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s ease, border-left-color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  border-radius: 0;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.ec:hover {
  box-shadow: 0 6px 20px rgba(234,88,12,0.12);
  border-left-color: var(--brand-red);
}
.ec--live { border-left-color: var(--brand-red); }
.ec--ended { border-left-color: #cbd5e1; }
.ec--swipeable { overflow: hidden; }
:root { --ec-tray-w: 160px; }
.ec-swipe-tray {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: var(--ec-tray-w); display: flex; z-index: 0;
  border-radius: 0;
}
.ec-swipe-inner {
  position: relative; z-index: 1; background: #fff;
  height: 100%; display: flex; flex-direction: column;
  will-change: transform; transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  touch-action: pan-y;
}
.ec--swiped .ec-swipe-inner { transform: translateX(calc(-1 * var(--ec-tray-w))); }

/* ── Card Header ── */
.ec-head {
  padding: 1.1rem 1.25rem 0.75rem 1.1rem;
  flex-shrink: 0;
  position: relative;
  border-bottom: 1px solid #f4f4f4;
}
.ec-head-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; }

/* Calendar badge — brand accent top bar */
.ec-cal {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: #fff8f5; border: 1px solid rgba(234,88,12,0.18);
  border-top: 3px solid var(--brand-orange);
  border-radius: 0; width: 48px; height: 52px; flex-shrink: 0;
}
.ec-cal-mon { font-size: 0.55rem; font-weight: 800; color: var(--brand-orange); text-transform: uppercase; letter-spacing: 0.05em; line-height: 1; }
.ec-cal-day { font-size: 1.25rem; font-weight: 800; color: #1e293b; line-height: 1.1; margin: 1px 0; }

/* Status pills */
.ec-status { padding: 0.3rem 0.7rem; border-radius: 0; font-size: 0.58rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.07em; display: flex; align-items: center; gap: 0.35rem; }
.ec-status--live { background: rgba(220,38,38,0.08); color: var(--brand-red); border: 1px solid rgba(220,38,38,0.2); }
.ec-status--upcoming { background: rgba(234,88,12,0.07); color: var(--brand-orange); border: 1px solid rgba(234,88,12,0.18); }
.ec-status--ended { background: #f1f5f9; color: #94a3b8; border: 1px solid #e2e8f0; }
.ec-live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brand-red); animation: ec-pulse 1.5s infinite; }
@keyframes ec-pulse { 0% { box-shadow: 0 0 0 0 rgba(220,38,38,0.4); } 70% { box-shadow: 0 0 0 8px rgba(220,38,38,0); } 100% { box-shadow: 0 0 0 0 rgba(220,38,38,0); } }

/* Event name & meta */
.ec-name { font-size: 1rem; font-weight: 700; color: #0f172a; line-height: 1.4; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; height: 2.8em; }
.ec-meta { display: flex; align-items: center; gap: 0.75rem; margin-top: 0.45rem; color: #94a3b8; font-size: 0.73rem; }
.ec-meta-item { display: flex; align-items: center; gap: 0.3rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Stats bar — brand gradient numbers ── */
.ec-stats { display: grid; grid-template-columns: repeat(3, 1fr); padding: 0.8rem 1.25rem; border-bottom: 1px solid #f4f4f4; background: #fdfcfb; flex-shrink: 0; }
.ec-stat { text-align: center; }
.ec-stat-num {
  font-size: 1.2rem; font-weight: 800; line-height: 1;
  background: var(--brand-grad);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.ec-stat-lbl { font-size: 0.55rem; font-weight: 700; color: #94a3b8; text-transform: uppercase; margin-top: 0.25rem; letter-spacing: 0.05em; }

/* ── Progress bar — brand gradient fill ── */
.ec-progress-container { padding: 0.7rem 1.25rem; flex-grow: 1; display: flex; flex-direction: column; justify-content: center; }
.ec-progress-bar { height: 4px; background: #f1f5f9; border-radius: 0; overflow: hidden; margin-bottom: 0.4rem; }
.ec-progress-fill { height: 100%; background: var(--brand-grad-h); border-radius: 0; transition: width 1s ease; }
.ec-progress-labels { display: flex; justify-content: space-between; font-size: 0.65rem; font-weight: 600; color: #94a3b8; }

/* ── Footer — more breathing room ── */
.ec-footer {
  padding: 1rem 1.25rem 1.1rem;
  background: #fdfcfb;
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.75rem;
  flex-shrink: 0;
  border-top: 1px solid #f4f4f4;
}

/* Pass badge */
.ec-pass-badge { font-size: 0.65rem; font-weight: 700; padding: 0.4rem 0.7rem; border-radius: 0; text-decoration: none; display: inline-flex; align-items: center; gap: 0.3rem; }
.ec-pass--set { background: rgba(234,88,12,0.08); color: var(--brand-orange); border: 1px solid rgba(234,88,12,0.2); }
.ec-pass--none { background: #f8fafc; color: #94a3b8; border: 1px dashed #e2e8f0; }

/* Icon action buttons */
.ec-actions { display: flex; align-items: center; gap: 0.5rem; }
.ec-btn-circle {
  width: 34px; height: 34px; border-radius: 0;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(234,88,12,0.2);
  background: rgba(234,88,12,0.04);
  color: var(--brand-orange); text-decoration: none; transition: all 0.18s;
}
.ec-btn-circle:hover { background: rgba(234,88,12,0.12); border-color: rgba(234,88,12,0.35); }

/* Primary CTA */
.ec-btn-main {
  background: var(--brand-grad);
  color: #fff; font-size: 0.7rem; font-weight: 800;
  padding: 0.55rem 1rem; border-radius: 0;
  text-decoration: none; text-transform: uppercase;
  letter-spacing: 0.05em; transition: opacity 0.18s;
  white-space: nowrap;
}
.ec-btn-main:active { opacity: 0.82; }
.ec-btn-main--ended { background: #94a3b8; }

/* Swipe hint */
.ec-swipe-hint { position: absolute; bottom: 1rem; right: 1.1rem; font-size: 0.55rem; font-weight: 800; color: rgba(234,88,12,0.25); text-transform: uppercase; letter-spacing: 0.1em; pointer-events: none; z-index: 5; }

/* ── Swipe tray — brand-toned ── */
.ec-tray-btn { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.35rem; color: #fff; text-decoration: none; font-weight: 800; font-size: 0.55rem; text-transform: uppercase; }
.ec-tray-checkin { background: var(--brand-red); }
.ec-tray-edit    { background: var(--brand-orange); }
.ec-tray-summary { background: #EA8008; }
.ec-tray-delete  { background: #1e293b; }

/* ── Purge Countdown — inline strip at card bottom ── */
.ec .purge-countdown {
  position: static !important;
  display: flex !important;
  align-items: center !important;
  gap: 0.45rem !important;
  padding: 0.45rem 1.25rem !important;
  margin: 0 !important;
  border-radius: 0 !important;
  border: none !important;
  border-top: 1px solid rgba(234,88,12,.15) !important;
  background: #fff7ed !important;
  color: #ea580c !important;
  font-size: 0.68rem !important;
  font-weight: 700 !important;
  box-shadow: none !important;
  pointer-events: none;
  flex-shrink: 0;
  transition: background 0.3s, color 0.3s;
}
.ec .purge-countdown.urgent {
  background: #fef2f2 !important;
  border-top-color: rgba(220,38,38,.2) !important;
  color: #dc2626 !important;
}
.ec .purge-countdown.overdue {
  background: #f8fafc !important;
  border-top-color: #e2e8f0 !important;
  color: #94a3b8 !important;
}
.ec .pcd-text { font-size: 0.68rem !important; color: inherit !important; }

/* ============================================================
   PASS CUSTOMIZE — MOBILE OVERRIDES
   Applies at ≤768px. The page's own inline CSS handles the
   Settings/Preview tab split at ≤900px.
   ============================================================ */
@media (max-width: 768px) {

  /* ── Panel spacing ── */
  .pc-panel {
    padding: 1rem 1rem 130px !important;
  }
  .pc-section {
    margin-bottom: 1.25rem !important;
  }
  .pc-section-title {
    font-size: .67rem !important;
    letter-spacing: .11em !important;
    margin-bottom: .75rem !important;
  }

  /* ── Font grid: stays 2-col, comfortable on mobile ── */
  .font-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: .4rem !important;
  }
  .font-btn {
    padding: .45rem .55rem !important;
  }
  .font-btn .fb-name { font-size: .74rem !important; }
  .font-btn .fb-sample { font-size: .62rem !important; margin-top: .1rem !important; }

  /* ── Event Name Style grid: 3-col but compact ── */
  .evns-grid {
    grid-template-columns: 1fr 1fr 1fr !important;
    gap: .3rem !important;
  }
  .evns-btn {
    padding: .5rem .25rem .4rem !important;
    gap: .1rem !important;
  }
  .evns-icon { font-size: .95rem !important; }
  .evns-lbl  { font-size: .64rem !important; }
  .evns-sub  { display: none !important; } /* hide descriptor on small screens */

  /* ── Template gallery: 2-col, full width ── */
  .tpl-gallery {
    grid-template-columns: 1fr 1fr !important;
    gap: .55rem !important;
  }
  .tpl-name { font-size: .7rem !important; }
  .tpl-desc { font-size: .58rem !important; }

  /* ── Colour pickers ── */
  .color-row {
    grid-template-columns: 1fr 1fr !important;
    gap: .5rem !important;
  }
  .color-pair {
    padding: .28rem .5rem !important;
  }
  .color-pair input[type=color] {
    width: 28px !important; height: 28px !important;
  }
  .color-pair span { font-size: .7rem !important; }

  /* ── Blend strength slider — bigger touch zone ── */
  .opacity-row {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: .4rem !important;
  }
  .opacity-row input[type=range] {
    width: 100% !important;
    height: 28px !important;   /* larger tap target */
    cursor: pointer;
  }
  .opacity-val {
    align-self: flex-end !important;
  }

  /* ── Background image position sliders ── */
  .bgp-row {
    flex-direction: column !important;
    gap: .35rem !important;
  }

  /* ── Text fields ── */
  .pc-field input[type=text],
  .pc-field textarea {
    font-size: 16px !important; /* Prevent iOS zoom */
  }

  /* ── Event selector ── */
  .event-select-bar {
    gap: .5rem !important;
    padding: .85rem 1rem !important;
  }
  .event-select-bar select {
    font-size: 16px !important; /* Prevent iOS zoom */
  }

  /* ── Action buttons: stack vertically ── */
  .pc-actions {
    flex-direction: column !important;
    gap: .45rem !important;
  }
  .pc-action-btn {
    width: 100% !important;
    justify-content: center !important;
    padding: .75rem 1rem !important;
    font-size: .78rem !important;
  }

  /* ── Generate Pass panel ── */
  .pc-print-panel {
    border-radius: 0 !important;
    border-left: none !important;
    border-right: none !important;
    margin: 0 -1rem !important;
    width: calc(100% + 2rem) !important;
  }
  .pcp-stats {
    grid-template-columns: 1fr 1fr 1fr !important;
  }
  .pcp-stat-num { font-size: 1.1rem !important; }
  .pcp-stat-lbl { font-size: .55rem !important; }
  .pcp-btn-wrap {
    flex-direction: column !important;
    gap: .5rem !important;
  }
  .pcp-generate {
    width: 100% !important;
    padding: .9rem !important;
    font-size: .82rem !important;
  }

  /* ── Mobile save bar ── */
  .pc-save-mobile {
    padding: .85rem 1rem calc(.85rem + env(safe-area-inset-bottom, 0px)) !important;
    box-shadow: 0 -6px 24px rgba(0,0,0,.14) !important;
  }
  .pc-save-mobile .pc-save-btn {
    font-size: .88rem !important;
    padding: .9rem !important;
  }

  /* ── Preview iframe ── */
  .preview-frame-wrap {
    max-width: 300px !important;
  }
  .preview-frame {
    border-radius: 0 !important;
  }
  .preview-label {
    font-size: .65rem !important;
  }

  /* ── Mobile tabs header ── */
  .pc-mobile-tabs {
    top: 52px !important;  /* below mobile-app-header */
    z-index: 100 !important;
  }
  .pc-tab {
    font-size: .8rem !important;
    padding: .8rem .5rem !important;
  }
}

/* Extra-small screens (≤375px) */
@media (max-width: 375px) {
  .evns-grid {
    grid-template-columns: 1fr 1fr !important; /* 2-col on very small screens */
  }
  .font-grid {
    grid-template-columns: 1fr 1fr !important;
  }
  .tpl-gallery {
    grid-template-columns: 1fr 1fr !important;
  }
  .pc-section-title { font-size: .64rem !important; }
}

/* ============================================================
   STAFF CHECK-IN — MOBILE TOUCH IMPROVEMENTS
   Page has its own excellent dark-theme CSS.
   These overrides improve touch targets & readability.
   ============================================================ */
@media (max-width: 768px) {

  /* ── Bigger check-in button (thumb-friendly) ── */
  .ci-btn {
    padding: 1.1rem 1.25rem !important;
    font-size: .95rem !important;
    min-width: 90px !important;
  }

  /* ── Taller input ── */
  .ci-input {
    padding: 1.1rem 1rem !important;
    font-size: 16px !important; /* Prevent iOS zoom */
  }

  /* ── Mode toggle buttons — full height ── */
  .mode-btn {
    padding: .9rem .5rem !important;
    font-size: .76rem !important;
  }

  /* ── Stats strip — bigger numbers ── */
  .ss-num {
    font-size: 1.65rem !important;
  }
  .ss-lbl {
    font-size: .62rem !important;
  }
  .ss-item {
    padding: 1rem .5rem !important;
  }

  /* ── Result card — more prominent ── */
  .ci-result {
    padding: 1.1rem 1.2rem !important;
    animation: slideInFast .18s ease !important;
  }
  @keyframes slideInFast {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .result-icon   { font-size: 1.65rem !important; }
  .result-title  { font-size: 1.05rem !important; }

  /* ── Activity list ── */
  .act-item {
    padding: .75rem .9rem !important;
  }
  .act-name  { font-size: .84rem !important; }
  .act-time  { font-size: .7rem !important; }

  /* ── Event selector ── */
  .event-bar select {
    font-size: 16px !important;
  }

  /* ── Mode toggle container ── */
  .mode-toggle {
    margin: 14px 14px 0 !important;
  }

  /* ── Input area ── */
  .ci-wrap {
    padding: 14px 14px !important;
  }

  /* ── Recent activity padding ── */
  .recent {
    padding: 0 14px 80px !important;
  }
}

/* ============================================================
   GLOBAL MOBILE FORM IMPROVEMENTS
   ============================================================ */
@media (max-width: 768px) {
  /* Prevent iOS auto-zoom on all text inputs */
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="password"],
  input[type="number"],
  input[type="search"],
  input[type="url"],
  select,
  textarea {
    font-size: 16px !important;
  }

  /* Buttons — minimum 44px tap target (Apple HIG) */
  button,
  .btn,
  a.btn,
  input[type="submit"],
  input[type="button"] {
    min-height: 44px;
    touch-action: manipulation;
  }

  /* Select dropdowns */
  select {
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23EA580C' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .75rem center;
    padding-right: 2.2rem !important;
  }
}

/* ============================================================
   EVENT CARD — MOBILE COLLAPSE / EXPAND
   Default: collapsed (header only). Tap to expand.
   ============================================================ */

/* Chevron hidden on desktop */
.ec-mob-chevron { display: none; }

@media (max-width: 768px) {

  /* ── Collapsed state (default on mobile) ── */
  .ec {
    margin-bottom: .45rem !important;
    border-left-width: 3px !important;
  }

  /* Hide all sections except the header by default */
  .ec-stats,
  .ec-progress-container,
  .ec-footer,
  .ec-swipe-hint,
  .purge-countdown {
    display: none !important;
  }

  /* Collapsed header — full clickable row */
  .ec-mob-toggle-head {
    cursor: pointer;
    padding-bottom: .9rem !important;
    user-select: none;
    -webkit-user-select: none;
  }
  .ec-mob-toggle-head:active {
    background: rgba(234,88,12,.03);
  }

  /* Head row: space-between with chevron on far right */
  .ec-head-row {
    align-items: center !important;
  }

  /* Mobile chevron */
  .ec-mob-chevron {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    width: 28px; height: 28px;
    color: #cbd5e1;
    flex-shrink: 0;
    transition: transform .22s cubic-bezier(.4,0,.2,1), color .18s;
    border-radius: 50%;
  }

  /* Event name — single line on collapsed, clamped */
  .ec .ec-name {
    font-size: .9rem !important;
    height: auto !important;
    -webkit-line-clamp: 1 !important;
    line-clamp: 1 !important;
    margin-top: .35rem !important;
    margin-bottom: 0 !important;
  }

  /* Meta row compact */
  .ec .ec-meta {
    font-size: .68rem !important;
    margin-top: .2rem !important;
    gap: .5rem !important;
  }

  /* ── Expanded state — tap to reveal ── */
  .ec--expanded .ec-stats {
    display: grid !important;
  }
  .ec--expanded .ec-progress-container {
    display: flex !important;
  }
  .ec--expanded .ec-footer {
    display: flex !important;
  }
  .ec--expanded .purge-countdown {
    display: flex !important;
  }
  .ec--expanded .ec-swipe-hint {
    display: block !important;
  }

  /* Chevron rotates on expand */
  .ec--expanded .ec-mob-chevron {
    transform: rotate(180deg);
    color: #EA580C;
  }

  /* Expanded card: slightly elevated */
  .ec--expanded {
    box-shadow: 0 4px 20px rgba(234,88,12,.10) !important;
    border-left-color: var(--brand-orange) !important;
    margin-bottom: .75rem !important;
  }

  /* ec-footer on mobile — stack if needed */
  .ec--expanded .ec-footer {
    flex-wrap: wrap !important;
    gap: .5rem !important;
    padding: .85rem 1rem !important;
  }
  .ec--expanded .ec-actions {
    gap: .4rem !important;
  }
  .ec--expanded .ec-btn-main {
    padding: .5rem .85rem !important;
    font-size: .68rem !important;
  }

  /* ec-secondary / danger buttons — hide on mobile unless expanded */
  .ec-btn-secondary,
  .ec-btn-danger {
    display: none !important;
  }
  .ec--expanded .ec-btn-secondary,
  .ec--expanded .ec-btn-danger {
    display: inline-flex !important;
    padding: .45rem .7rem !important;
    font-size: .65rem !important;
    font-weight: 700 !important;
    border: 1.5px solid #e2e8f0 !important;
    color: #64748b !important;
    background: #f8fafc !important;
  }
  .ec--expanded .ec-btn-danger {
    color: #ef4444 !important;
    border-color: rgba(239,68,68,.25) !important;
    background: rgba(239,68,68,.04) !important;
  }

  /* ── Dashboard: stats row 2×2 on mobile ── */
  .stats-row {
    grid-template-columns: 1fr 1fr !important;
    gap: .65rem !important;
    margin-bottom: 1.5rem !important;
  }
  .stat-card {
    padding: 1rem !important;
    border-radius: 0 !important;
  }
  .stat-num {
    font-size: 1.6rem !important;
  }
  .stat-sub {
    font-size: .72rem !important;
  }

  /* ── Quick Actions slider ── */
  .quick-row {
    display: flex !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory !important;
    -webkit-overflow-scrolling: touch !important;
    gap: .75rem !important;
    padding: 0 1rem 0 1rem !important;
    scrollbar-width: none !important;
  }
  .quick-row::-webkit-scrollbar { display: none; }
  .quick-card {
    scroll-snap-align: start !important;
    flex: 0 0 calc(85vw - 2rem) !important;
    min-width: 0 !important;
    border-radius: 0 !important;
  }

  /* ── Section header ── */
  .section-hd {
    margin-bottom: .65rem !important;
    padding: 0 !important;
  }
  .section-hd h2 {
    font-size: 1rem !important;
  }
  .section-hd p {
    font-size: .75rem !important;
  }

  /* ── Sidebar: hide on mobile ── */
  .sidebar {
    display: none !important;
  }

  /* ── Page body: no padding on mobile ── */
  .page-body {
    padding: .85rem 1rem !important;
  }

  /* ── Topbar: hidden on mobile (replaced by mobile-app-header) ── */
  .topbar {
    display: none !important;
  }
}

/* ============================================================
   CREATE EVENT v2 — MOBILE
   Covers new redesign classes: ce-body, ce-card, ce-progress,
   ce-sidebar, ce-fee, ce-foot, ce-card-hd, ce-card-body, f-row
   ============================================================ */
@media (max-width: 768px) {

  /* Two-column body → single column; hide sticky sidebar */
  .ce-body {
    grid-template-columns: 1fr !important;
    gap: 0 !important;
    padding: 0 !important;
  }
  .ce-sidebar {
    display: none !important;
  }

  /* Progress step strip — horizontal scroll on very small screens */
  .ce-progress {
    overflow-x: auto !important;
    scrollbar-width: none !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 0 .75rem !important;
    gap: 0 !important;
  }
  .ce-progress::-webkit-scrollbar { display: none; }
  .ce-step {
    flex-shrink: 0 !important;
    padding: .7rem .85rem !important;
    font-size: .72rem !important;
    min-width: 80px !important;
  }
  .ce-step-num { font-size: .65rem !important; }
  .ce-step-lbl { font-size: .7rem !important; }

  /* Cards — remove horizontal padding, full bleed */
  .ce-cards {
    padding: 0 !important;
  }
  .ce-card {
    border-left: none !important;
    border-right: none !important;
    margin-bottom: 2px !important;
  }
  .ce-card-hd {
    padding: .9rem 1rem !important;
    gap: .65rem !important;
  }
  .ce-card-num {
    width: 28px !important;
    height: 28px !important;
    font-size: .72rem !important;
    flex-shrink: 0 !important;
  }
  .ce-card-title { font-size: .92rem !important; }
  .ce-card-sub   { font-size: .72rem !important; }
  .ce-card-body  { padding: 0 1rem 1.1rem !important; }

  /* Form rows inside cards → single column */
  .f-row {
    grid-template-columns: 1fr !important;
    gap: .65rem !important;
  }

  /* Pricing block — compact on mobile */
  .ce-fee {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: .75rem !important;
    padding: 1rem !important;
  }
  .ce-fee-amt { font-size: 1.45rem !important; }
  .ce-fee-chips {
    flex-direction: row !important;
    flex-wrap: wrap !important;
    text-align: left !important;
    gap: .4rem .75rem !important;
  }
  .ce-fee-chip { justify-content: flex-start !important; font-size: .68rem !important; }
  .ce-fee-tier { margin-top: .25rem !important; }

  /* Submit row — stack buttons full-width */
  .ce-foot {
    flex-direction: column-reverse !important;
    gap: .6rem !important;
    padding: 1rem !important;
    border-top: 1px solid var(--border) !important;
  }
  .ce-foot .btn {
    width: 100% !important;
    justify-content: center !important;
    padding: .9rem 1rem !important;
  }

  /* Event type pills — 3-col on mobile */
  .cat-pills {
    grid-template-columns: 1fr 1fr 1fr !important;
    gap: .4rem !important;
  }
  .cpill {
    padding: .6rem .25rem !important;
    font-size: .7rem !important;
  }

  /* Date/time row — already covered by f-row, but ensure end row too */
  .ce-card-body .f {
    margin-bottom: 0 !important;
  }
}

/* ============================================================
   SUBSCRIPTION PAGE — MOBILE
   ============================================================ */
@media (max-width: 768px) {

  /* Section panels */
  .pf-section {
    border-left: none !important;
    border-right: none !important;
    margin-bottom: 2px !important;
  }
  .pf-head {
    padding: 1rem 1.1rem !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: .25rem !important;
  }
  .pf-head h2 { font-size: 1rem !important; }
  .pf-head p  { font-size: .75rem !important; }
  .pf-body    { padding: 1rem 1.1rem !important; }

  /* Current plan — stack to 2-col compact */
  .pf-body > div[style*="grid-template-columns"] {
    grid-template-columns: 1fr 1fr !important;
    gap: 1rem !important;
    max-width: 100% !important;
  }

  /* Tier upgrade cards — single column stack */
  .upgrades-grid {
    grid-template-columns: 1fr !important;
    gap: .75rem !important;
  }
  .up-card {
    border-left: 3px solid var(--border) !important;
  }
  .up-card.active {
    border-left-color: #EA580C !important;
  }
  .up-head {
    padding: 1.1rem 1rem !important;
    text-align: left !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
  }
  .up-price { font-size: 1.65rem !important; }
  .up-body {
    padding: .85rem 1rem 1.1rem !important;
    text-align: left !important;
    justify-content: flex-start !important;
  }
  .up-limit { margin-bottom: .9rem !important; font-size: .82rem !important; }
  .up-body .btn { font-size: .8rem !important; }

  /* Success alert */
  .pf-success { font-size: .82rem !important; }
}

/* ============================================================
   PROFILE PAGE — MOBILE
   ============================================================ */
@media (max-width: 768px) {

  /* Profile sections */
  .prof-section,
  .pf-section {
    border-left: none !important;
    border-right: none !important;
  }

  /* Two-column form rows → single column */
  .prof-row,
  .form-row-2col {
    grid-template-columns: 1fr !important;
    gap: .65rem !important;
  }

  /* Partners / Staff tables → card list */
  .partners-table,
  .staff-table {
    display: block !important;
    overflow: visible !important;
  }
  .partners-table thead,
  .staff-table thead { display: none !important; }
  .partners-table tbody,
  .staff-table tbody { display: flex !important; flex-direction: column !important; gap: .5rem !important; }
  .partners-table tr,
  .staff-table tr {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: .4rem !important;
    background: #fff !important;
    border: 1px solid var(--border) !important;
    padding: .75rem 1rem !important;
  }
  .partners-table td,
  .staff-table td {
    display: block !important;
    border: none !important;
    padding: 0 !important;
    font-size: .82rem !important;
  }
  .partners-table td:last-child,
  .staff-table td:last-child {
    margin-left: auto !important;
  }
}

/* ============================================================
   MY-EVENTS PAGE — MOBILE
   ============================================================ */
@media (max-width: 768px) {

  /* Filter pills → horizontal scroll strip */
  .me-filter-bar {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    scrollbar-width: none !important;
    -webkit-overflow-scrolling: touch !important;
    margin-left: -.9rem !important;
    margin-right: -.9rem !important;
    padding: 0 .9rem .65rem !important;
    gap: .4rem !important;
    margin-bottom: .75rem !important;
  }
  .me-filter-bar::-webkit-scrollbar { display: none; }
  .me-fpill {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    font-size: .74rem !important;
  }

  /* Event count strip */
  .me-counts-row {
    grid-template-columns: 1fr 1fr !important;
    gap: .5rem !important;
    margin-bottom: .85rem !important;
  }
}

/* ============================================================
   ADMIN PAGES — MOBILE
   ============================================================ */
@media (max-width: 768px) {

  /* Hide desktop admin sidebar */
  .admin-side,
  .admin-sidebar { display: none !important; }

  /* Main content full-width */
  .admin-layout,
  .admin-wrap {
    display: block !important;
  }
  .admin-main,
  .admin-content-area {
    width: 100% !important;
    padding: 0 !important;
  }

  /* Admin topbar compact */
  .admin-topbar,
  .topbar {
    padding: .7rem .9rem !important;
    font-size: .82rem !important;
  }

  /* Admin mobile menu trigger (added via PHP) */
  .adm-mob-menu-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    background: none;
    border: 1px solid rgba(255,255,255,.1);
    color: var(--txt);
    cursor: pointer;
    flex-shrink: 0;
  }

  /* Page body */
  .page-body,
  .admin-page-body { padding: .85rem .9rem !important; }

  /* Panel cards */
  .panel {
    border-left: none !important;
    border-right: none !important;
    max-width: 100% !important;
  }
  .panel-head {
    padding: 1rem 1rem !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: .65rem !important;
  }
  .panel-body { padding: .85rem 1rem !important; }

  /* ── Transform data tables into card list on mobile ── */
  .data-table-wrap { overflow: visible !important; }
  .data-table {
    display: block !important;
    width: 100% !important;
  }
  .data-table thead { display: none !important; }
  .data-table tbody {
    display: flex !important;
    flex-direction: column !important;
    gap: .5rem !important;
  }
  .data-table tr {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: flex-start !important;
    gap: .3rem .75rem !important;
    background: #fff !important;
    border: 1px solid var(--border) !important;
    border-left: 3px solid #EA580C !important;
    padding: .85rem 1rem !important;
    font-size: .82rem !important;
    position: relative !important;
  }
  .data-table td {
    display: inline-flex !important;
    align-items: center !important;
    border: none !important;
    padding: 0 !important;
    font-size: .82rem !important;
  }
  .data-table td:before {
    content: attr(data-label) ': ';
    font-weight: 700;
    font-size: .65rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #9ca3af;
    margin-right: .3rem;
    white-space: nowrap;
  }
  /* Actions column — always full row at bottom */
  .data-table td:last-child {
    flex-basis: 100% !important;
    justify-content: flex-end !important;
    padding-top: .5rem !important;
    border-top: 1px solid var(--border) !important;
    margin-top: .35rem !important;
    gap: .4rem !important;
  }
  .data-table td:last-child:before { display: none !important; }

  /* Table toolbar */
  .table-toolbar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: .55rem !important;
    padding: .75rem .9rem !important;
  }
  .tb-search {
    width: 100% !important;
    font-size: 16px !important;
  }

  /* Tier rows for pricing page */
  .tier-row {
    grid-template-columns: 1fr !important;
    gap: .65rem !important;
    background: #faf9f6 !important;
    padding: 1rem !important;
    border: 1px solid var(--border) !important;
    position: relative !important;
  }
  .tier-remove-btn {
    position: absolute !important;
    top: .85rem !important; right: .85rem !important;
  }

  /* Admin stat cards */
  .admin-stats,
  .stats-row { grid-template-columns: 1fr 1fr !important; gap: .55rem !important; }

  /* Breadcrumb */
  .breadcrumb { font-size: .65rem !important; }
  .page-title  { font-size: 1.05rem !important; }

  /* Mob-menu button in admin topbar */
  .mob-menu-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
}

/* ============================================================
   PUBLIC EVENT PAGES — MOBILE
   (page-view.php, page-ticket.php, page-ticket-confirm.php)
   ============================================================ */
@media (max-width: 768px) {

  /* Event page header compact */
  .evp-header,
  .ep-nav {
    padding: .75rem 1rem !important;
    flex-wrap: wrap !important;
    gap: .5rem !important;
  }

  /* Hero section — reduce padding */
  .evp-hero,
  .ep-hero { padding: 2rem 1.1rem 1.5rem !important; }
  .evp-hero h1 { font-size: clamp(1.6rem, 7vw, 2.2rem) !important; }

  /* Two-column layouts → single column */
  .evp-grid,
  .ep-grid,
  .ticket-wrap {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  /* Ticket confirmation card */
  .ticket-card {
    padding: 1.25rem 1.1rem !important;
  }

  /* CTA buttons full width */
  .evp-actions .btn,
  .ep-cta .btn,
  .ticket-actions .btn {
    width: 100% !important;
    justify-content: center !important;
    padding: .9rem 1rem !important;
  }
  .evp-actions,
  .ep-cta,
  .ticket-actions {
    flex-direction: column !important;
    gap: .6rem !important;
  }
}