/* Rush Events Patch 28 — camera and cross-device runtime hardening v28.0.0 */
/* Honour the HTML hidden state even when component classes set display. */
[hidden] { display: none !important; }
/* Rush Events Patch 15 — post-release mobile stability corrections v15.0.0 */
:root {
  --rush-safe-top: env(safe-area-inset-top, 0px);
  --rush-safe-right: env(safe-area-inset-right, 0px);
  --rush-safe-bottom: env(safe-area-inset-bottom, 0px);
  --rush-safe-left: env(safe-area-inset-left, 0px);
  --rush-mobile-vh: 1vh;
  --rush-visual-height: 100dvh;
  --rush-keyboard-offset: 0px;
  --rush-touch-target: 48px;
}
html, body { width: 100%; max-width: 100%; min-height: 100%; overflow-x: clip; }
body { min-height: calc(var(--rush-mobile-vh) * 100); overscroll-behavior-x: none; -webkit-text-size-adjust: 100%; }
img, video, canvas, svg, iframe, table { max-width: 100%; }
.ui-main, .ui-page-frame, .ui-patron-container, .ui-checkout-grid, .ui-checkout-form, .ui-ticket-detail-grid { min-width: 0; }
.ui-mobile-only { display: none; }
.ui-network-banner {
  position: fixed; z-index: 180; left: max(.65rem,var(--rush-safe-left)); right: max(.65rem,var(--rush-safe-right));
  top: calc(max(.65rem,var(--rush-safe-top)) + var(--rush-announcement-height,0px));
  min-height: 46px; display: flex; align-items: center; justify-content: center; gap: .55rem;
  padding: .65rem .9rem; border: 1px solid rgba(255,255,255,.14); border-radius: 999px;
  background: rgba(15,15,18,.94); box-shadow: 0 16px 55px rgba(0,0,0,.45); backdrop-filter: blur(18px);
  font-size: .72rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase;
  transform: translateY(-170%); opacity: 0; pointer-events: none; transition: transform .22s ease, opacity .22s ease;
}
.ui-network-banner.is-visible { transform: translateY(0); opacity: 1; }
.ui-network-banner.is-offline { border-color: rgba(251,191,36,.35); color: #fde68a; }
.ui-network-banner.is-online { border-color: rgba(52,211,153,.35); color: #a7f3d0; }
.ui-pwa-install-sheet {
  position: fixed; z-index: 181; left: max(.65rem,var(--rush-safe-left)); right: max(.65rem,var(--rush-safe-right));
  bottom: max(.65rem,var(--rush-safe-bottom)); max-width: 34rem; margin-inline: auto;
  padding: 1rem; border-radius: 1.5rem; border: 1px solid rgba(255,255,255,.13);
  background: rgba(12,12,15,.98); box-shadow: 0 28px 90px rgba(0,0,0,.62); backdrop-filter: blur(22px);
  transform: translateY(calc(100% + 2rem)); opacity: 0; pointer-events: none; transition: transform .24s ease, opacity .24s ease;
}
.ui-pwa-install-sheet.is-open { transform: translateY(0); opacity: 1; pointer-events: auto; }
.ui-pwa-install-sheet__head { display:flex; align-items:flex-start; gap:.8rem; }
.ui-pwa-install-sheet__icon { width:3rem; height:3rem; border-radius:1rem; display:grid; place-items:center; flex:0 0 auto; background:linear-gradient(135deg,#ec4899,#8b5cf6); font-weight:950; }
.ui-pwa-install-sheet__copy { min-width:0; flex:1; }
.ui-pwa-install-sheet__copy strong { display:block; font-size:1rem; }
.ui-pwa-install-sheet__copy p { margin-top:.25rem; color:rgba(255,255,255,.6); font-size:.82rem; line-height:1.45; }
.ui-pwa-install-sheet__actions { margin-top:.9rem; display:grid; grid-template-columns:1fr 1fr; gap:.65rem; }
.ui-pwa-install-sheet button { min-height:var(--rush-touch-target); border-radius:999px; font-weight:850; }
.ui-pwa-install-sheet [data-pwa-install-confirm] { background:#fff; color:#08080a; }
.ui-pwa-install-sheet [data-pwa-install-close] { border:1px solid rgba(255,255,255,.14); }
[data-pwa-install][hidden] { display:none !important; }

/* Mobile dialogs and sheets */
@media (max-width: 720px) {
  .ui-mobile-only { display: initial; }
  :where(button,a,input,select,textarea,summary) { touch-action: manipulation; }
  input, select, textarea { font-size: 16px !important; }
  .field, .input-dark { min-height: 50px; }
  .pill-primary, .pill-secondary, .pill-ghost, .ui-patron-primary-action, .ui-patron-secondary-action { min-height: var(--rush-touch-target); }
  [role="dialog"] { max-height: var(--rush-visual-height); }
  .ui-command-palette__dialog,
  .ui-patron-more-drawer,
  [data-guestlist-modal] > div,
  .ui-modal__dialog,
  .ui-sheet {
    border-bottom-left-radius: 0 !important; border-bottom-right-radius: 0 !important;
    padding-bottom: max(1rem,var(--rush-safe-bottom));
  }
  body.ui-keyboard-open .ui-patron-bottom-nav,
  body.ui-keyboard-open .ui-checkout-actions,
  body.ui-keyboard-open .ui-staff-form-actions { transform: translateY(115%); pointer-events:none; }
  body.ui-keyboard-open .ui-pwa-install-sheet { display:none; }
}

.ui-checkout-summary-toggle { display: none; }

/* Phone-first checkout */
@media (max-width: 820px) {
  .ui-checkout-page { padding: calc(var(--patron-header-height,64px) + var(--rush-announcement-height,0px) + 1rem) .75rem calc(var(--patron-bottom-height,72px) + var(--rush-safe-bottom) + 1.3rem) !important; }
  .ui-checkout-heading { gap:1rem; }
  .ui-checkout-heading h1 { font-size: clamp(2.1rem,11vw,3.6rem) !important; line-height:.98; }
  .ui-checkout-security { width:100%; }
  .ui-checkout-progress { display:flex; gap:.45rem; overflow-x:auto; scroll-snap-type:x mandatory; scrollbar-width:none; padding:.15rem .1rem .45rem; }
  .ui-checkout-progress::-webkit-scrollbar { display:none; }
  .ui-checkout-progress__step { min-width:8.1rem; scroll-snap-align:start; justify-content:flex-start; }
  .ui-checkout-grid { display:flex !important; flex-direction:column; gap:.8rem !important; }
  .ui-checkout-form { order:1; min-width:0; }
  .ui-checkout-summary { order:0; position:static !important; max-height:none; }
  .ui-checkout-summary__hero { min-height:5.4rem; }
  .ui-checkout-summary__hero img { width:4.5rem; height:4.5rem; object-fit:cover; border-radius:1rem; }
  .ui-checkout-summary__rows > div:not(.ui-checkout-summary__total) { display:none; }
  .ui-checkout-summary.is-expanded .ui-checkout-summary__rows > div { display:flex; }
  .ui-checkout-summary__footer, .ui-checkout-summary form { display:none; }
  .ui-checkout-summary.is-expanded .ui-checkout-summary__footer,
  .ui-checkout-summary.is-expanded form { display:flex; }
  .ui-checkout-summary-toggle { width:100%; min-height:44px; display:flex; align-items:center; justify-content:space-between; gap:.7rem; color:rgba(255,255,255,.75); font-size:.75rem; font-weight:850; text-transform:uppercase; letter-spacing:.1em; }
  .ui-checkout-panel { border-radius:1.45rem !important; padding:1rem !important; }
  .ui-checkout-panel__header { align-items:flex-start; }
  .ui-ticket-choice-grid { grid-template-columns:1fr !important; }
  .ui-ticket-choice { min-height:86px; }
  .ui-checkout-fields { grid-template-columns:1fr !important; }
  .ui-quantity-control { width:100%; grid-template-columns:56px 1fr 56px; }
  .ui-quantity-control button { min-height:54px; font-size:1.45rem; }
  .ui-promo-control { grid-template-columns:minmax(0,1fr) auto; }
  .ui-checkout-actions {
    position: sticky; z-index:24; bottom: calc(var(--patron-bottom-height,72px) + var(--rush-safe-bottom) + .4rem);
    margin:1rem -.25rem -.25rem; padding:.65rem; border:1px solid rgba(255,255,255,.12); border-radius:1.15rem;
    background:rgba(8,8,11,.94); box-shadow:0 18px 55px rgba(0,0,0,.5); backdrop-filter:blur(18px);
    transition:transform .2s ease;
  }
  .ui-checkout-actions > * { flex:1; justify-content:center; min-width:0; }
  .ui-checkout-pay-button { font-size:.72rem !important; letter-spacing:.08em !important; }
}
@media (max-width: 420px) {
  .ui-checkout-progress__step { min-width:7.25rem; }
  .ui-checkout-actions { display:grid !important; grid-template-columns:.72fr 1.28fr; }
  .ui-checkout-panel__header .code-chip { max-width:8rem; white-space:normal; text-align:center; }
}

/* One-handed patron wallet */
@media (max-width: 720px) {
  .ui-patron-page-header { align-items:stretch !important; gap:1rem; }
  .ui-patron-page-header > .ui-patron-primary-action { width:100%; justify-content:center; }
  .ui-wallet-toolbar { position:sticky; z-index:18; top:calc(var(--patron-header-height,64px) + var(--rush-announcement-height,0px) + .35rem); padding:.45rem; margin-inline:-.2rem; border:1px solid rgba(255,255,255,.09); border-radius:1.1rem; background:rgba(8,8,11,.92); backdrop-filter:blur(18px); }
  .ui-wallet-tabs { width:100%; overflow-x:auto; scrollbar-width:none; scroll-snap-type:x mandatory; }
  .ui-wallet-tabs::-webkit-scrollbar { display:none; }
  .ui-wallet-tab { min-width:6.8rem; scroll-snap-align:start; }
  .ui-wallet-view-setting { display:none !important; }
  .ui-ticket-wallet { grid-template-columns:1fr !important; gap:.8rem !important; }
  .ui-wallet-ticket { border-radius:1.4rem !important; }
  .ui-wallet-ticket__footer { align-items:stretch !important; flex-direction:column; }
  .ui-wallet-ticket__footer > a { width:100%; justify-content:center; }
  .ui-wallet-ticket__details { grid-template-columns:1fr !important; }
  .ui-patron-info-strip { align-items:flex-start; }
  .ui-patron-info-strip > a { width:100%; text-align:center; }
}

/* Full-screen QR presentation that also works where the Fullscreen API is limited */
.ui-ticket-presentation {
  position:fixed; z-index:220; inset:0; display:grid; grid-template-rows:auto 1fr auto; gap:.8rem;
  padding:max(.8rem,var(--rush-safe-top)) max(.8rem,var(--rush-safe-right)) max(.9rem,var(--rush-safe-bottom)) max(.8rem,var(--rush-safe-left));
  background:#fff; color:#050507; transform:translateY(105%); opacity:0; visibility:hidden; transition:transform .22s ease,opacity .22s ease;
}
.ui-ticket-presentation.is-open { transform:translateY(0); opacity:1; visibility:visible; }
.ui-ticket-presentation__header { display:flex; align-items:center; justify-content:space-between; gap:.75rem; }
.ui-ticket-presentation__header strong { font-size:1rem; }
.ui-ticket-presentation__close { width:48px; height:48px; border-radius:999px; display:grid; place-items:center; background:#0b0b0d; color:white; }
.ui-ticket-presentation__body { min-height:0; display:grid; place-items:center; align-content:center; gap:.7rem; }
.ui-ticket-presentation__qr { width:min(82vmin,36rem); aspect-ratio:1; background:#fff; display:grid; place-items:center; }
.ui-ticket-presentation__qr img,.ui-ticket-presentation__qr canvas,.ui-ticket-presentation__qr svg { width:100% !important; height:100% !important; }
.ui-ticket-presentation__code { font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-weight:900; font-size:clamp(1rem,4.5vw,1.45rem); letter-spacing:.08em; }
.ui-ticket-presentation__footer { text-align:center; }
.ui-ticket-presentation__footer strong { display:block; }
.ui-ticket-presentation__footer p { margin-top:.25rem; font-size:.8rem; color:#52525b; }
.ui-ticket-offline-actions { display:grid; gap:.55rem; margin-top:.75rem; }
.ui-ticket-offline-note { font-size:.72rem; color:rgba(255,255,255,.5); text-align:center; line-height:1.45; }
body.ui-ticket-presenting { overflow:hidden; background:#fff; }
@media (orientation:landscape) and (max-height:560px) {
  .ui-ticket-presentation { grid-template-columns:auto 1fr; grid-template-rows:auto 1fr; }
  .ui-ticket-presentation__header { grid-column:1/-1; }
  .ui-ticket-presentation__body { grid-column:1; }
  .ui-ticket-presentation__qr { width:min(72vh,34rem); }
  .ui-ticket-presentation__footer { grid-column:2; align-self:center; text-align:left; max-width:18rem; }
}

/* Staff command drawer and mobile page tools */
@media (max-width: 1023px) {
  .ui-mobile-drawer--staff { width:min(94vw,27rem) !important; padding-left:var(--rush-safe-left); }
  .ui-mobile-drawer__header { padding-top:max(.8rem,var(--rush-safe-top)); }
  .ui-mobile-drawer__scroll { overscroll-behavior:contain; }
  .ui-mobile-staff-link, .ui-drawer-footer-link, .ui-mobile-quick-grid a, .ui-command-trigger--mobile { min-height:52px; }
  .ui-staff-page-tools__actions { max-width:100%; overflow-x:auto; scrollbar-width:none; padding-bottom:.25rem; }
  .ui-staff-page-tools__actions::-webkit-scrollbar { display:none; }
  .ui-staff-page-tools__actions > * { flex:0 0 auto; }
}
@media (max-width: 760px) {
  .ui-staff-table-wrap { overflow:visible !important; }
  .ui-staff-table-wrap table { min-width:0 !important; width:100%; }
  .ui-staff-filter-panel { max-height:calc(var(--rush-visual-height) - 8rem); overflow:auto; overscroll-behavior:contain; }
}

/* Door scanner: large one-hand controls, portrait and landscape */
[data-door-scanner] { min-height:var(--rush-visual-height) !important; overflow-x:clip; }
[data-door-scanner] .rush-door-compact-button { min-height:54px !important; font-size:.74rem !important; }
[data-door-scanner] #door-confirm-bracelet,
[data-door-scanner] #door-resume { min-height:58px; font-size:1rem; }
[data-door-scanner] .rush-door-awake { min-height:48px; }
@media (max-width: 639px) {
  [data-door-scanner] > header { padding-top:max(.7rem,var(--rush-safe-top)) !important; }
  [data-door-scanner] > main { padding-bottom:max(1rem,var(--rush-safe-bottom)) !important; }
  [data-door-scanner] .rush-door-control-grid { grid-template-columns:1fr 1fr !important; }
  [data-door-scanner] .rush-door-control-grid > button { width:100%; }
  [data-door-scanner] #door-start-camera,
  [data-door-scanner] #door-stop-camera { grid-column:1/-1; min-height:60px !important; font-size:.82rem !important; }
}
@media (orientation:landscape) and (max-height:620px) and (max-width:1023px) {
  [data-door-scanner] main > .grid { grid-template-columns:minmax(0,1.2fr) minmax(18rem,.8fr) !important; align-items:start; }
  [data-door-scanner] .rush-door-camera-stage { height:calc(var(--rush-visual-height) - 9.5rem) !important; min-height:260px !important; }
  [data-door-scanner] #door-result { min-height:150px !important; }
  [data-door-scanner] details { display:none; }
}

/* Standalone PWA and reduced motion */
@media (display-mode: standalone) {
  body { padding-top:var(--rush-safe-top); }
  .ui-site-nav, .ui-patron-header, .ui-admin-header { padding-top:var(--rush-safe-top); }
  .ui-patron-bottom-nav { padding-bottom:max(.45rem,var(--rush-safe-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
  .ui-network-banner,.ui-pwa-install-sheet,.ui-ticket-presentation { transition:none !important; }
}


/* Patch 15 — authenticated mobile shell hardening */
@media (max-width: 1023px) {
  body.ui-staff-shell .ui-page-frame--staff,
  body.ui-staff-shell .ui-main--staff {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding-left: 0 !important;
    margin-left: 0 !important;
  }
  body.ui-staff-shell .ui-main--staff > section,
  body.ui-patron-shell .ui-main > section {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }
  .ui-mobile-drawer,
  .ui-command-palette__dialog,
  .ui-patron-more-drawer {
    max-width: calc(100vw - var(--rush-safe-left) - var(--rush-safe-right)) !important;
  }
  .ui-staff-page-tools {
    right: 0;
    width: auto;
    max-width: 100vw;
    box-sizing: border-box;
  }
  .ui-staff-page-tools__actions {
    min-width: 0;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-inline: contain;
  }
  .ui-staff-filter-form,
  .ui-staff-table-toolbar,
  .ui-staff-pagination,
  .ui-staff-form,
  .ui-staff-card,
  .glass-card {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }
}

@media (max-width: 760px) {
  body.ui-staff-shell .ui-main--staff > .ui-staff-page {
    padding-top: calc(var(--rush-nav-height, 4.25rem) + var(--rush-announcement-height, 0px) + 4.35rem) !important;
    padding-bottom: calc(1.25rem + var(--rush-safe-bottom)) !important;
  }
  body.ui-patron-shell .ui-main {
    padding-bottom: calc(var(--patron-bottom-height, 72px) + var(--rush-safe-bottom));
  }
  .ui-staff-filter-actions,
  .ui-staff-form-actions,
  .ui-patron-page-header__actions,
  .ui-checkout-actions {
    max-width: 100%;
  }
  .ui-staff-filter-actions > *,
  .ui-staff-form-actions > *,
  .ui-patron-page-header__actions > * {
    min-width: 0;
  }
  .ui-responsive-table tbody td,
  .ui-responsive-table tbody td > *,
  .ui-staff-data-table tbody td,
  .ui-staff-data-table tbody td > * {
    max-width: 100%;
    min-width: 0;
  }
  .ui-responsive-table a,
  .ui-responsive-table button,
  .ui-responsive-table code {
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  dialog,
  [role="dialog"],
  .ui-modal__dialog,
  .ui-sheet {
    width: min(100%, calc(100vw - 1rem - var(--rush-safe-left) - var(--rush-safe-right))) !important;
    max-width: none !important;
    margin-inline: auto !important;
  }
}

@media (max-width: 390px) {
  .ui-staff-page-tools__context { max-width: 28vw; }
  .ui-staff-page-tools__copy strong { max-width: 28vw; }
  .ui-page-tool-button,
  .ui-page-primary-action { flex: 0 0 2.35rem; }
  .ui-patron-bottom-nav a,
  .ui-patron-bottom-nav button { min-width: 0; }
}

/* Patch 15 — minimum touch targets for authenticated controls */
@media (max-width: 760px) {
  .ui-page-tool-button,
  .ui-page-primary-action {
    width: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    flex-basis: 44px !important;
  }
  .ui-patron-header__actions .ui-patron-buy-button {
    width: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    padding: .55rem !important;
  }
  .ui-wallet-tab { min-height: 44px !important; }
  .ui-patron-bottom-link,
  .ui-patron-bottom-buy { min-height: 52px !important; }
}
