/* Edge IFC — last-loaded mobile completion
   Public site, client portal, admin, login, signup. */

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

img, video, iframe, svg, canvas {
  max-width: 100%;
  height: auto;
}

input, select, textarea {
  font-size: 16px !important;
  max-width: 100%;
}

.btn, button, input[type="submit"], input[type="button"],
.vc-btn, .udash-btn, .udash-btn-ghost, .btn-p-gold,
.sidebarCollapse, .header.navbar .nav-link,
.mobile-bottom-nav a {
  touch-action: manipulation;
}

/* Hamburger must stay available — full menu is not in the bottom bar */
.header-container .sidebarCollapse,
a.sidebarCollapse {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  width: auto !important;
  margin: 0 !important;
  flex-shrink: 0;
}

/* Header chrome must never become full-width stacked buttons */
.header-container .btn,
.header.navbar .btn,
.navbar-item .btn,
.navbar-dropdown .nav-link {
  width: auto !important;
  margin-bottom: 0 !important;
}

.table-responsive,
.dataTables_wrapper,
.widget-content-area {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 991.98px) {
  .mobile-bottom-nav {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    justify-content: space-around !important;
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    height: auto !important;
    min-height: 56px;
    margin: 0 !important;
    padding: 0.2rem 0 calc(0.25rem + env(safe-area-inset-bottom, 0px)) !important;
    background: #0b0b0c !important;
    border-top: 1px solid rgba(212,175,55,.22) !important;
    z-index: 1100 !important;
    box-sizing: border-box !important;
  }
  .mobile-bottom-nav ul {
    display: flex !important;
    flex-direction: row !important;
    flex: 1 1 auto !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
  }
  .mobile-bottom-nav li {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    display: flex !important;
  }
  .mobile-bottom-nav > a,
  .mobile-bottom-nav a {
    flex: 1 1 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.15rem;
    min-width: 0 !important;
    width: auto !important;
    max-width: none !important;
    min-height: 52px !important;
    margin: 0 !important;
    padding: 0.35rem 0.15rem !important;
    text-align: center !important;
    text-decoration: none !important;
    font-size: 0.65rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.04em;
    line-height: 1.15 !important;
    color: rgba(244,241,234,.6) !important;
  }
  .mobile-bottom-nav i,
  .mobile-bottom-nav svg {
    display: block !important;
    float: none !important;
    position: static !important;
    margin: 0 auto 0.15rem !important;
    font-size: 1.2rem !important;
    width: 22px;
    height: 22px;
    color: #d4af37 !important;
  }
  .mobile-bottom-nav li.nav-center a { top: -8px; }
  .mobile-bottom-nav li.nav-center .nav-icon-wrapper {
    width: 48px;
    height: 48px;
  }

  #content.main-content,
  .main-content {
    padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px)) !important;
  }
  .footer-wrapper {
    margin-bottom: calc(76px + env(safe-area-inset-bottom, 0px)) !important;
  }
  .chat-widget-container {
    bottom: calc(88px + env(safe-area-inset-bottom, 0px)) !important;
    right: 12px;
  }
  .chat-bubble-label { display: none !important; }
  .pwa-install-banner {
    bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  }
  .tp-sticky {
    bottom: calc(64px + env(safe-area-inset-bottom, 0px)) !important;
    z-index: 1070;
  }
  .header-container {
    padding-top: env(safe-area-inset-top, 0px);
  }
  .dropdown-menu.notification-menu {
    position: fixed !important;
    left: 8px !important;
    right: 8px !important;
    width: auto !important;
    max-width: none !important;
    top: calc(72px + env(safe-area-inset-top, 0px)) !important;
  }
  .udash-desks { grid-template-columns: 1fr 1fr !important; }
  .udash-metrics { grid-template-columns: 1fr !important; }
  .rcpt-grid,
  .profile-grid,
  .security-grid,
  .summary-grid { grid-template-columns: 1fr !important; }
  .filters-row { flex-direction: column !important; align-items: stretch !important; }
  .filters-row .group { min-width: 0 !important; width: 100%; }
  .page-header { flex-direction: column; align-items: stretch !important; }
}

@media (min-width: 992px) {
  .mobile-bottom-nav { display: none !important; }
}

@media (max-width: 767.98px) {
  .udash-desks { grid-template-columns: 1fr !important; }
  .udash-row {
    grid-template-columns: 1fr 1fr !important;
  }
  .card-actions { grid-template-columns: 1fr 1fr !important; }
  .table-premium th,
  .table-premium td,
  table.dataTable th,
  table.dataTable td {
    white-space: normal !important;
  }
  .rcpt-row { flex-wrap: wrap; }
  .rcpt-lab { width: 100%; min-width: 0; padding-bottom: 0; }
  .rcpt-val { width: 100%; }
  .rcpt-actions a,
  .rcpt-actions button { flex: 1 1 100%; }
  .notice-row { grid-template-columns: 36px 1fr; }
  .notice-row form { grid-column: 1 / -1; }
  .wizard-steps { gap: 0.2rem; }
  .step-label { font-size: 0.68rem; text-align: center; }
  .premium-profile-header { flex-direction: column; }
  .premium-profile-header .ms-auto { margin-left: 0 !important; width: 100%; }
  .premium-profile-header .ms-auto a { width: 100%; justify-content: center; }
  .form-container,
  .auth-card {
    margin: 0 auto !important;
    max-width: 100% !important;
    border-radius: 0 !important;
  }
  .vc-news-form { flex-direction: column; }
  .vc-news-form button { width: 100%; min-height: 44px; }
}

@media (max-width: 575.98px) {
  /* Override responsive.css "all buttons 100%" for chrome only */
  .header-container .btn,
  .navbar .btn,
  .sidebarCollapse { width: auto !important; }

  .layout-px-spacing { padding-left: 12px !important; padding-right: 12px !important; }
  .brand-modern .brand-text p { display: none !important; }
  .navbar-nav .nav-link span { display: none !important; }
  .card-actions { grid-template-columns: 1fr !important; }
  .udash-actions a,
  .udash-actions button { flex: 1 1 100%; }
  .register-container { padding: 1.25rem 0 !important; }
}

@media (max-width: 359.98px) {
  .brand-modern .brand-text { display: none !important; }
  .vc-logo span { display: none; }
}

/* Public drawer: tappable rows */
.vc-drawer-panel a {
  min-height: 44px;
  display: flex;
  align-items: center;
}
.vc-drawer-panel {
  padding-top: calc(1.25rem + env(safe-area-inset-top, 0px));
  overflow-y: auto;
}

/* Auth / PIN */
.pin-container .form-container,
.login-container .form-container {
  width: min(100%, 480px);
}

@media print {
  .mobile-bottom-nav,
  .chat-widget-container,
  .pwa-install-banner,
  .tp-sticky { display: none !important; }
}
