/* ─────────────────────────────────────────────────────────────────────────
   runtime-overrides.css — was previously injected from app/runtime-css.js
   at runtime (which caused a brief FOUC). Loaded as a real stylesheet now,
   after the other CSS files, so cascade order alone wins.

   Section A — native UX performance tweaks
   Section B — upload progress + credentials modal animations
   ───────────────────────────────────────────────────────────────────────── */

/* ══ A · NATIVE UX PERFORMANCE TWEAKS ════════════════════════════════════ */
html, body { touch-action: manipulation; }
#screen-container { contain: layout style; }

/* DEBUG · pull #main-content up behind the fixed top-nav (applies to BOTH
   primary and secondary pages so layout stays identical across both).
   .app-body normally has margin-top = nav+safe-top to clear the nav; we
   zero it so #main-content's top edge sits at y=0 under the nav. The
   .screen inside gets compensating padding-top so actual content still
   starts below the nav (only the orange container extends up). */
body .app-body,
body.mobile-secondary-page .app-body,
body.fullscreen-page .app-body { margin-top: 0 !important; }

body .screen,
body .screen.layout-page,
body.mobile-secondary-page .screen,
body.mobile-secondary-page .screen.layout-page,
body.fullscreen-page .screen {
  padding-top: calc(var(--nav-height) + var(--safe-top)) !important;
}

/* Search bars are visible everywhere. Only special wizard overrides below. */
.wizard-page .page-search-bar,
.wizard-page .page-search-row,
.wizard-page .search-input-wrap { display: flex !important; }
.wizard-page #wiz-step3-search { display: block !important; }

.card, .stat-card, .vendor-card, .event-card, .task-card {
  box-shadow: 0 1px 2px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.05) !important;
}

.btn-gold, .btn-secondary, .btn-ghost {
  border-radius: var(--r-full) !important;
  letter-spacing: 0.01em;
}

.crm-panel {
  border-radius: var(--r-md) !important;
  border: none !important;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.05) !important;
  overflow: hidden;
}
.crm-panel-head {
  padding: 11px 14px 10px !important;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 0 !important;
  background: transparent;
}
.crm-panel-head h3 { font-size: 13px !important; font-weight: 700 !important; letter-spacing: 0; }
@media (max-width: 768px) {
  .crm-panel-head { padding: 12px 14px 9px !important; }
}

.top-nav,
.plt-ios .top-nav,
.plt-android .top-nav {
  border: 0 !important;
  border-top: 0 !important;
  border-bottom: 0 !important;
  box-shadow: none !important;
  background: #FFFFFF !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
.top-nav::before,
.top-nav::after {
  display: none !important;
  content: none !important;
}

/* Hard seal: remove any visual seam between status bar and app bar */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0;
  height: calc(var(--safe-top) + 2px);
  background: #FFFFFF;
  z-index: 650;
  pointer-events: none;
}
.top-nav {
  margin-top: -1px !important;
  padding-top: calc(var(--safe-top) + 1px) !important;
  transform: translateZ(0) !important;
}
body.mobile-secondary-page .page-back-btn { display: none !important; }

/* Remove bottom tab parallax frame completely */
#bottom-nav, #bottom-nav-items {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  background: #FFFFFF !important;
  box-shadow: none !important;
}
#bottom-nav::before, #bottom-nav::after,
#bottom-nav-items::before, #bottom-nav-items::after {
  content: none !important;
  display: none !important;
  box-shadow: none !important;
  background: transparent !important;
}

.screen {
  will-change: auto;
  backface-visibility: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}

@media (prefers-reduced-motion: reduce) {
  .screen, .screen * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ══ B · UPLOAD / MODAL ANIMATIONS ═══════════════════════════════════════ */
@keyframes slideUp {
  from { opacity: 0; transform: translateX(-50%) translateY(24px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.88); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes upPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(26,115,232,0.5); }
  50%      { box-shadow: 0 0 0 6px rgba(26,115,232,0); }
}
#upload-progress-overlay div[style*="animation:pulse"] {
  animation: upPulse 1.2s infinite !important;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes indeterminate {
  0%   { transform: translateX(-100%); width: 60%; }
  50%  { transform: translateX(60%);   width: 60%; }
  100% { transform: translateX(200%);  width: 60%; }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
