/**
 * Compact-phone shell (html.mh-compact-phone, CSS width ≤ 480px).
 * Fills the visible screen with small gutters. Loaded last so it wins over
 * older Galaxy S23 packing (overflow:hidden + 4px sides).
 */

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

html.mh-compact-phone,
html.mh-compact-phone body {
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}

html.mh-compact-phone body {
  min-height: 100vh;
  min-height: 100dvh;
  min-height: 100svh;
}

/* Host Login on index.html (not only host-dashboard.html): never clip it off-screen. */
html.mh-host-login-open,
html.mh-host-login-open body,
html.mh-compact-phone.mh-host-login-open,
html.mh-compact-phone.mh-host-login-open body,
html.mh-host-path-pending,
html.mh-host-path-pending body,
html.mh-compact-phone body.mh-host-login-open,
html.mh-compact-phone body.auth-open {
  overflow: auto !important;
  height: auto !important;
  max-height: none !important;
  min-height: 100dvh !important;
  background: #1e293b !important;
  opacity: 1 !important;
  visibility: visible !important;
}
html.mh-host-login-open #authModal,
html.mh-compact-phone.mh-host-login-open #authModal,
html.mh-compact-phone body.mh-host-login-open #authModal,
html.mh-compact-phone body.auth-open #authModal,
html.mh-host-path-pending #authModal {
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 100dvh !important;
  overflow: auto !important;
  -webkit-overflow-scrolling: touch !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  z-index: 100080 !important;
  background: #1e293b !important;
  pointer-events: auto !important;
  transform: none !important;
  animation: none !important;
}
html.mh-host-login-open #authModal .mh-host-login-card,
html.mh-host-login-open #authModal > div,
html.mh-compact-phone #authModal .mh-host-login-card,
html.mh-compact-phone #authModal > div {
  overflow: visible !important;
  transform: none !important;
  animation: none !important;
  opacity: 1 !important;
  visibility: visible !important;
  min-height: calc(100dvh - 24px) !important;
}

html.mh-boot-hold #landing,
html.mh-boot-hold body #landing,
html.mh-boot-hold #landing.landing-optimized,
html.mh-boot-hold body #landing.landing-optimized,
html.mh-boot-hold html body #landing {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  height: 0 !important;
  overflow: hidden !important;
}

@media (max-width: 480px) {
  html, body {
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
    min-height: 100dvh;
  }

  html body #landing.landing-optimized,
  html body #landing,
  body #landing.landing-optimized,
  body #landing,
  #landing.landing-optimized,
  #landing {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    padding-top: max(6px, env(safe-area-inset-top, 0px)) !important;
    padding-right: max(8px, env(safe-area-inset-right, 0px)) !important;
    padding-bottom: max(8px, env(safe-area-inset-bottom, 0px)) !important;
    padding-left: max(8px, env(safe-area-inset-left, 0px)) !important;
    min-height: 100dvh !important;
    height: auto !important;
    max-height: none !important;
    overflow: auto !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: stretch !important;
  }

  html.mh-boot-hold body #landing,
  html.mh-boot-hold html body #landing,
  html.mh-boot-hold #landing.landing-optimized,
  html.mh-boot-hold body #landing.landing-optimized,
  html.mh-boot-hold #landing,
  html.mh-welcome-open body #landing,
  html.mh-welcome-open #landing,
  html.mh-wait-role-choice body #landing,
  html.mh-wait-role-choice #landing,
  body.mh-role-onboarding-flow #landing,
  html body.mh-role-onboarding-flow #landing {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    height: 0 !important;
  }

  html body #landing .landing-content,
  body #landing .landing-content,
  #landing .landing-content,
  .landing-content {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box !important;
    flex: 1 1 0% !important;
    min-height: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    display: flex !important;
    flex-direction: column !important;
  }

  html body #hostDashboardContainer,
  #hostDashboardContainer {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
}

/* —— Home / landing —— */
html.mh-compact-phone body #landing.landing-optimized,
html.mh-compact-phone body #landing,
html.mh-compact-phone #landing.landing-optimized,
html.mh-compact-phone #landing {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  padding-top: max(6px, env(safe-area-inset-top, 0px)) !important;
  padding-right: max(8px, env(safe-area-inset-right, 0px), clamp(8px, 2.5vw, 14px)) !important;
  padding-bottom: max(8px, env(safe-area-inset-bottom, 0px)) !important;
  padding-left: max(8px, env(safe-area-inset-left, 0px), clamp(8px, 2.5vw, 14px)) !important;
  min-height: 100vh !important;
  min-height: 100dvh !important;
  min-height: 100svh !important;
  height: 100vh !important;
  height: 100dvh !important;
  height: 100svh !important;
  max-height: 100vh !important;
  max-height: 100dvh !important;
  max-height: 100svh !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: stretch !important;
}

html.mh-compact-phone body #landing .landing-content,
html.mh-compact-phone #landing .landing-content,
html.mh-compact-phone .landing-content {
  width: 100% !important;
  max-width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  box-sizing: border-box !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  padding-bottom: max(6px, env(safe-area-inset-bottom, 0px)) !important;
  flex: 1 1 0% !important;
  min-height: 0 !important;
  height: auto !important;
  max-height: none !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

html.mh-compact-phone #landing .copyright,
html.mh-compact-phone body #landing .copyright {
  margin-top: auto !important;
}

/* Helper registration: keep helper home from covering the form */
html.mh-volunteer-open #landing,
html.mh-volunteer-open body #landing,
html.mh-compact-phone.mh-volunteer-open #landing,
html.mh-compact-phone.mh-volunteer-open body #landing,
html.mh-compact-phone body.mh-volunteer-open #landing,
html.mh-compact-phone body.mh-volunteer-open #landing.landing-optimized,
html.mh-compact-phone:has(#volunteerMode:not(.hidden)) #landing,
html.mh-compact-phone:has(#volunteerMode:not(.hidden)) body #landing,
html.mh-compact-phone:has(#volunteerMode:not(.hidden)) #landing.landing-optimized {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  height: 0 !important;
  max-height: 0 !important;
  min-height: 0 !important;
  overflow: hidden !important;
  position: absolute !important;
  left: -9999px !important;
}

html.mh-compact-phone #landing .main-buttons {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  flex: 1 1 auto !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-evenly !important;
  gap: clamp(10px, 2.2vh, 22px) !important;
  margin-top: clamp(4px, 1vh, 10px) !important;
  margin-bottom: clamp(4px, 1vh, 10px) !important;
}

html.mh-compact-phone #landing .helper-section,
html.mh-compact-phone #landing .host-section {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  padding: clamp(10px, 1.8vh, 18px) clamp(8px, 2.5vw, 14px) !important;
}

html.mh-compact-phone #landing .helper-buttons,
html.mh-compact-phone #landing .host-buttons,
html.mh-compact-phone #landing .action-button,
html.mh-compact-phone #landing .register-button {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

html.mh-compact-phone #landing .action-button {
  min-height: clamp(48px, 7vh, 56px) !important;
  height: auto !important;
}

html.mh-compact-phone #landing .housekeeping,
html.mh-compact-phone #landing .host-registration,
html.mh-compact-phone #landing .footer-links {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* Helper / Edit Profile / volunteer screens on the home page */
html.mh-compact-phone #volunteerMode:not(.hidden),
html.mh-compact-phone #completionMode:not(.hidden),
html.mh-compact-phone #adminMode:not(.hidden) {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  min-height: 100dvh !important;
  min-height: 100svh !important;
  padding-top: max(6px, env(safe-area-inset-top, 0px)) !important;
  padding-right: max(8px, env(safe-area-inset-right, 0px), clamp(8px, 2.5vw, 14px)) !important;
  padding-bottom: max(8px, env(safe-area-inset-bottom, 0px)) !important;
  padding-left: max(8px, env(safe-area-inset-left, 0px), clamp(8px, 2.5vw, 14px)) !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

html.mh-compact-phone #volunteerMode:not(.hidden) .app-container,
html.mh-compact-phone #completionMode:not(.hidden) .app-container {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

@media screen and (max-width: 600px) {
  html.mh-compact-phone #completionMode:not(.hidden) .mh-edit-profile-header,
  html.mh-compact-phone #completionMode[style*="display: block"] .mh-edit-profile-header {
    display: flex !important;
    flex-wrap: nowrap !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 8px !important;
    width: 100% !important;
  }
  html.mh-compact-phone #completionMode:not(.hidden) .mh-edit-profile-header > div:first-child {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    max-width: calc(100% - 84px) !important;
  }

  html.mh-compact-phone #completionMode:not(.hidden) #completionModeHeaderBackBtn,
  html.mh-compact-phone #completionMode[style*="display: block"] #completionModeHeaderBackBtn {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    top: auto !important;
    right: auto !important;
    z-index: 20 !important;
    flex: 0 0 auto !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 72px !important;
    min-height: 40px !important;
    height: 40px !important;
    margin: 0 0 0 auto !important;
    padding: 0 14px !important;
    border: none !important;
    border-radius: 8px !important;
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%) !important;
    color: #fff !important;
    font-size: 0.88rem !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
    pointer-events: auto !important;
  }

  html.mh-compact-phone #completionMode:not(.hidden) #completionModeBackBtn,
  html.mh-compact-phone #completionMode[style*="display: block"] #completionModeBackBtn {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
}

/* —— Team Builder Dashboard —— */
html.mh-compact-phone.mh-results-page,
html.mh-compact-phone.mh-results-page body {
  padding-left: max(8px, env(safe-area-inset-left, 0px), clamp(8px, 2.5vw, 14px)) !important;
  padding-right: max(8px, env(safe-area-inset-right, 0px), clamp(8px, 2.5vw, 14px)) !important;
  padding-top: max(6px, env(safe-area-inset-top, 0px)) !important;
  padding-bottom: max(8px, env(safe-area-inset-bottom, 0px)) !important;
  box-sizing: border-box !important;
  overflow-x: hidden !important;
}

html.mh-compact-phone #team-results-v2,
html.mh-compact-phone .mh-results-v2,
html.mh-compact-phone .results-container,
html.mh-compact-phone .results-header {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

html.mh-compact-phone .mh-results-v2 {
  padding-left: clamp(4px, 1.5vw, 10px) !important;
  padding-right: clamp(4px, 1.5vw, 10px) !important;
}

html.mh-compact-phone .mh-results-v2 .mh-team-dashboard,
html.mh-compact-phone .mh-results-v2 .mh-recommended,
html.mh-compact-phone .mh-results-v2 .mh-activity-feed {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  padding: clamp(6px, 2vw, 12px) clamp(8px, 2.5vw, 14px) !important;
}

html.mh-compact-phone .mh-results-v2 .mh-volunteer-card {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

html.mh-compact-phone .mh-results-v2 .mh-team-dashboard,
html.mh-compact-phone .mh-results-v2 .mh-team-dashboard h2 {
  font-size: clamp(0.85rem, 3.6vw, 1.1rem) !important;
}

html.mh-compact-phone .mh-results-v2 .mh-dash-section-title,
html.mh-compact-phone .mh-results-v2 .mh-final-team-title {
  font-size: clamp(0.9rem, 3.8vw, 1.2rem) !important;
}

/* —— Host dashboard —— */
html.mh-compact-phone.mh-host-page #hostDashboardContainer,
html.mh-compact-phone #hostDashboardContainer,
html.mh-compact-phone body #hostDashboardContainer {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: max(8px, env(safe-area-inset-left, 0px), clamp(8px, 2.5vw, 14px)) !important;
  padding-right: max(8px, env(safe-area-inset-right, 0px), clamp(8px, 2.5vw, 14px)) !important;
  padding-top: max(6px, env(safe-area-inset-top, 0px)) !important;
  padding-bottom: max(8px, env(safe-area-inset-bottom, 0px)) !important;
  min-height: 100% !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  overflow-x: hidden !important;
  overflow-y: visible !important;
  -webkit-overflow-scrolling: touch;
}

html.mh-compact-phone #hostDashboardHeaderRow,
html.mh-compact-phone.mh-host-page #hostDashboardHeaderRow {
  top: max(6px, env(safe-area-inset-top, 0px)) !important;
  z-index: 200 !important;
}
html.mh-compact-phone.host-withdraw-open #hostDashboardHeaderRow,
html.mh-compact-phone.mh-host-page.host-withdraw-open #hostDashboardHeaderRow {
  z-index: 100090 !important;
  background: #ffffff !important;
}
html.mh-compact-phone.host-withdraw-open #hostDashboardContainer > *:not(#hostDashboardHeaderRow):not(#hostWithdrawFormSection),
html.mh-compact-phone.mh-host-page.host-withdraw-open #hostDashboardContainer > *:not(#hostDashboardHeaderRow):not(#hostWithdrawFormSection) {
  visibility: hidden !important;
  pointer-events: none !important;
}
html.mh-compact-phone.host-withdraw-open #hostWithdrawFormSection,
html.mh-compact-phone.mh-host-page.host-withdraw-open #hostWithdrawFormSection {
  background: #0f172a !important;
  opacity: 1 !important;
  visibility: visible !important;
}

html.mh-compact-phone #hostDashboardContainer .project-card,
html.mh-compact-phone #projectsList {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* —— Register / simple public forms —— */
html.mh-compact-phone body.register-org-page,
html.mh-compact-phone.mh-simple-page body {
  padding-top: max(8px, env(safe-area-inset-top, 0px)) !important;
  padding-right: max(8px, env(safe-area-inset-right, 0px), clamp(8px, 2.5vw, 14px)) !important;
  padding-bottom: max(8px, env(safe-area-inset-bottom, 0px)) !important;
  padding-left: max(8px, env(safe-area-inset-left, 0px), clamp(8px, 2.5vw, 14px)) !important;
  min-height: 100dvh !important;
  min-height: 100svh !important;
  height: auto !important;
  max-height: none !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  box-sizing: border-box !important;
}

html.mh-compact-phone .register-shell,
html.mh-compact-phone.mh-simple-page .container {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

html.mh-compact-phone .register-shell {
  margin-left: auto !important;
  margin-right: auto !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

/* —— Super host —— */
html.mh-compact-phone.mh-super-host-page body,
html.mh-compact-phone .super-host-container,
html.mh-compact-phone #superHostDashboard {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

html.mh-compact-phone.mh-super-host-page body {
  padding-top: max(6px, env(safe-area-inset-top, 0px)) !important;
  padding-right: max(8px, env(safe-area-inset-right, 0px), clamp(8px, 2.5vw, 14px)) !important;
  padding-bottom: max(8px, env(safe-area-inset-bottom, 0px)) !important;
  padding-left: max(8px, env(safe-area-inset-left, 0px), clamp(8px, 2.5vw, 14px)) !important;
}

/* —— Shared modals: small inset, use the visible window —— */
html.mh-compact-phone #infoModal,
html.mh-compact-phone #welcomeTourModal,
html.mh-compact-phone #hostPricingModalOverlay,
html.mh-compact-phone #helperConfirmationModal,
html.mh-compact-phone #mapModal,
html.mh-compact-phone #teamMapModal {
  padding: max(6px, env(safe-area-inset-top, 0px))
    max(8px, env(safe-area-inset-right, 0px))
    max(8px, env(safe-area-inset-bottom, 0px))
    max(8px, env(safe-area-inset-left, 0px)) !important;
  box-sizing: border-box !important;
}

html.mh-compact-phone #infoModal,
html.mh-compact-phone #infoModal > div,
html.mh-compact-phone #infoModal .modal-container,
html.mh-compact-phone #infoModalContainer,
html.mh-compact-phone #welcomeTourModal > div,
html.mh-compact-phone .pricing-modal,
html.mh-compact-phone #hostPricingModalOverlay > div,
html.mh-compact-phone #helperConfirmationModal > div,
html.mh-compact-phone #mhRecordReplyModal {
  width: calc(100% - 16px) !important;
  max-width: 100% !important;
  max-height: calc(100dvh - 16px) !important;
  max-height: calc(100svh - 16px) !important;
  box-sizing: border-box !important;
}

/* Helper landing: gray helper box fills space above copyright; buttons grow equally. */
html.mh-compact-phone body.mh-role-helper #landing.landing-optimized,
html.mh-compact-phone #landing.mh-role-helper.landing-optimized {
  display: flex !important;
  flex-direction: column !important;
  height: 100vh !important;
  height: 100dvh !important;
  height: 100svh !important;
  min-height: 100dvh !important;
}

html.mh-compact-phone body.mh-role-helper #landing .landing-content,
html.mh-compact-phone #landing.mh-role-helper .landing-content {
  display: flex !important;
  flex-direction: column !important;
  min-height: 0 !important;
  max-height: none !important;
  height: 100% !important;
  flex: 1 1 auto !important;
  padding-bottom: 42px !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

html.mh-compact-phone body.mh-role-helper #landing .main-buttons,
html.mh-compact-phone #landing.mh-role-helper .main-buttons {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  justify-content: stretch !important;
  gap: clamp(8px, 1.6vh, 14px) !important;
  margin-top: clamp(4px, 1vh, 8px) !important;
  margin-bottom: 0 !important;
}

html.mh-compact-phone body.mh-role-helper #landing .helper-section,
html.mh-compact-phone #landing.mh-role-helper .helper-section {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  justify-content: stretch !important;
  margin-bottom: 0 !important;
}

html.mh-compact-phone body.mh-role-helper #landing .helper-buttons,
html.mh-compact-phone #landing.mh-role-helper .helper-buttons {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  flex: 1 1 auto !important;
  justify-content: stretch !important;
  min-height: 0 !important;
  gap: 12px !important;
}

html.mh-compact-phone body.mh-role-helper #landing .helper-buttons > .action-group-small,
html.mh-compact-phone #landing.mh-role-helper .helper-buttons > .action-group-small {
  flex: 1 1 0 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: stretch !important;
  min-height: 0 !important;
}

html.mh-compact-phone body.mh-role-helper #landing .action-button,
html.mh-compact-phone body.mh-role-helper #landing #btnVolunteer,
html.mh-compact-phone body.mh-role-helper #landing #btnCompletion,
html.mh-compact-phone #landing.mh-role-helper .action-button {
  min-height: clamp(132px, 20vh, 200px) !important;
  max-height: none !important;
  height: auto !important;
  padding: 18px 16px !important;
  flex: 1 1 0 !important;
}

html.mh-compact-phone body.mh-role-helper #landing .copyright,
html.mh-compact-phone #landing.mh-role-helper .copyright,
html.mh-compact-phone body.mh-role-helper #landing p.copyright {
  margin-top: 8px !important;
  margin-bottom: 4px !important;
  flex: 0 0 auto !important;
  flex-shrink: 0 !important;
}

html.mh-compact-phone body.mh-role-helper #landing #mhHelperChangePath,
html.mh-compact-phone #landing.mh-role-helper #mhHelperChangePath {
  flex: 0 0 auto !important;
  margin-top: 2px !important;
  margin-bottom: 0 !important;
}

html.mh-compact-phone body.mh-role-helper #landing .footer-links,
html.mh-compact-phone #landing.mh-role-helper .footer-links {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  height: 0 !important;
  max-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

@media (max-width: 480px) and (max-height: 740px) {
  html.mh-compact-phone body.mh-role-helper #landing .helper-buttons {
    gap: 10px !important;
  }
  html.mh-compact-phone body.mh-role-helper #landing .helper-section {
    margin-top: 4px !important;
    padding: clamp(8px, 1.2vh, 12px) clamp(8px, 2.5vw, 14px) !important;
  }
}

/* Keep 900px desktop cap on host dashboard when not a phone */
@media (min-width: 481px) {
  #hostDashboardContainer.app-container,
  #hostDashboardContainer {
    max-width: 900px;
  }
}

/* Galaxy S23: never use position:fixed full-screen overlays or 100dvh locks. */
@media (max-width: 480px) {
  html.mh-host-page,
  html.mh-host-page body {
    overflow: auto !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    height: auto !important;
    min-height: 100% !important;
    max-height: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
  }
  html.mh-host-page.mh-host-opening,
  html.mh-host-page.mh-host-opening body {
    background: #10243d !important;
  }
  html.mh-host-page.mh-host-ready:not(.mh-host-painted),
  html.mh-host-page.mh-host-ready:not(.mh-host-painted) body {
    background: #10243d !important;
  }
  html.mh-host-page.mh-host-painted,
  html.mh-host-page.mh-host-painted body {
    background: #eef2f7 !important;
  }
  html.mh-host-page #loginTransitionOverlay {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    z-index: -1 !important;
  }
  html.mh-host-page.mh-host-opening #mhDashBootSplash {
    display: block !important;
    background: #10243d !important;
    color: #e8eef4 !important;
    min-height: 100vh !important;
    min-height: 100dvh !important;
  }
  html.mh-host-page.mh-host-ready #mhDashBootSplash {
    display: none !important;
  }
  html.mh-host-page #hostDashboardContainer,
  html.mh-host-page.mh-compact-phone #hostDashboardContainer,
  html.mh-compact-phone #hostDashboardContainer {
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
    overflow: visible !important;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
  }
  html.mh-host-page #mhThinkOverlay,
  html.mh-host-page #mhThinkOverlay.is-on {
    display: none !important;
  }
  html.mh-host-page body.mh-host-login-open,
  html.mh-host-page body.auth-open {
    background: #10243d !important;
  }
  html.mh-host-page #authModal {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    inset: auto !important;
    width: 100% !important;
    height: auto !important;
    min-height: 100% !important;
    display: block !important;
    overflow: visible !important;
    transform: none !important;
    animation: none !important;
    opacity: 1 !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    background: #1e293b !important;
  }
  html.mh-host-page #authModal .mh-host-login-card,
  html.mh-host-page #authModal > div {
    position: relative !important;
    overflow: visible !important;
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    max-height: none !important;
    height: auto !important;
    min-height: calc(100dvh - 24px) !important;
  }
  html.mh-host-page.mh-host-ready:not(.mh-host-painted),
  html.mh-host-page.mh-host-ready:not(.mh-host-painted) body {
    background: #10243d !important;
  }
  html.mh-host-page.mh-host-painted,
  html.mh-host-page.mh-host-painted body {
    background: #eef2f7 !important;
  }
}

/* Happening now sits over Team in progress — keep the page scrollable behind it. */
html.mh-compact-phone.mh-happen-now-open,
html.mh-compact-phone.mh-happen-now-open body,
html.mh-happen-now-open.mh-results-page,
html.mh-happen-now-open.mh-results-page body {
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior-y: auto;
  height: auto !important;
  max-height: none !important;
}
html.mh-compact-phone.mh-happen-now-open body,
html.mh-happen-now-open.mh-results-page body,
html.mh-happen-now-open #team-results-v2 {
  padding-bottom: max(16px, var(--mh-happen-now-space, 160px)) !important;
}

/* Desktop Host Login: centered white card on a light canvas. Phone overlay stays as-is. */
@media screen and (min-width: 601px) {
  html.mh-host-login-open,
  html.mh-host-login-open body,
  html.mh-host-path-pending,
  html.mh-host-path-pending body,
  body.mh-host-login-open,
  body.auth-open,
  html.mh-host-page body.mh-host-login-open,
  html.mh-host-page body.auth-open,
  html[data-mh-host-signin="1"] body {
    background: #f1f5f9 !important;
  }

  html.mh-host-login-open #authModal,
  html.mh-host-path-pending #authModal,
  html.mh-compact-phone.mh-host-login-open #authModal,
  body.mh-host-login-open #authModal,
  body.auth-open #authModal,
  html.mh-host-page body.mh-host-login-open #authModal,
  html.mh-host-page body.auth-open #authModal,
  html[data-mh-host-signin="1"] #authModal {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 100dvh !important;
    padding: 48px 24px !important;
    box-sizing: border-box !important;
    overflow: auto !important;
    background: #f1f5f9 !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  html.mh-host-login-open #authModal .mh-host-login-card,
  html.mh-host-login-open #authModal > div,
  html.mh-host-page body.mh-host-login-open #authModal .mh-host-login-card,
  html.mh-host-page body.mh-host-login-open #authModal > div,
  html.mh-host-page body.auth-open #authModal .mh-host-login-card,
  html.mh-host-page body.auth-open #authModal > div,
  html[data-mh-host-signin="1"] #authModal > div,
  html[data-mh-host-signin="1"] #authModal .mh-host-login-card {
    width: min(420px, calc(100% - 48px)) !important;
    max-width: 420px !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    margin: 0 auto !important;
    padding: 0 !important;
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 16px !important;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08) !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    text-align: left !important;
    align-self: center !important;
  }

  html.mh-host-login-open #authModal .mh-host-login-card > div:first-child,
  html.mh-host-page #authModal .mh-host-login-card > div:first-child,
  html[data-mh-host-signin="1"] .mh-login-head {
    background: #ffffff !important;
    color: #0f172a !important;
    padding: 36px 36px 12px !important;
    text-align: center !important;
    overflow: visible !important;
  }

  html.mh-host-login-open #authModal .mh-host-login-card > div:first-child > div[style*="position: absolute"] {
    display: none !important;
  }

  html.mh-host-login-open #authModal .mh-host-login-logo,
  html[data-mh-host-signin="1"] .mh-host-login-logo {
    margin-bottom: 18px !important;
    padding: 8px 12px !important;
    border-radius: 10px !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
  }

  html.mh-host-login-open #authModal .mh-host-login-logo img,
  html[data-mh-host-signin="1"] .mh-host-login-logo img {
    height: 32px !important;
    max-width: 210px !important;
  }

  html.mh-host-login-open #authModal .mh-host-login-card > div:first-child h2,
  html[data-mh-host-signin="1"] .mh-login-head h1 {
    color: #0f172a !important;
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    letter-spacing: -0.02em !important;
    line-height: 1.25 !important;
    text-shadow: none !important;
    margin: 0 0 6px 0 !important;
  }

  html.mh-host-login-open #authModal .mh-host-login-card > div:first-child p,
  html[data-mh-host-signin="1"] .mh-login-head p {
    color: #64748b !important;
    font-size: 0.95rem !important;
    font-weight: 400 !important;
    line-height: 1.45 !important;
  }

  html.mh-host-login-open #authModal .mh-host-login-card > div:first-child + div {
    padding: 8px 36px 32px !important;
  }

  html.mh-host-login-open #authModal #loginForm {
    gap: 16px !important;
  }

  html.mh-host-login-open #authModal #loginForm label,
  html[data-mh-host-signin="1"] form label {
    color: #334155 !important;
    font-size: 0.8125rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.01em !important;
    margin-bottom: 6px !important;
  }

  html.mh-host-login-open #authModal #loginForm input,
  html[data-mh-host-signin="1"] form input {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    padding: 11px 14px !important;
    font-size: 0.95rem !important;
    min-height: 44px !important;
    box-shadow: none !important;
  }

  html.mh-host-login-open #authModal #authPassword {
    padding-right: 44px !important;
  }

  html.mh-host-login-open #authModal #loginForm button[type="submit"],
  html[data-mh-host-signin="1"] button[type="submit"] {
    background: #2563eb !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 8px !important;
    min-height: 44px !important;
    padding: 12px 18px !important;
    font-size: 0.95rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.01em !important;
    box-shadow: none !important;
    margin-top: 4px !important;
    transform: none !important;
  }

  html.mh-host-login-open #authModal #loginForm button[type="submit"]:hover,
  html[data-mh-host-signin="1"] button[type="submit"]:hover {
    background: #1d4ed8 !important;
    transform: none !important;
    box-shadow: none !important;
  }

  html.mh-host-login-open #authModal .mh-host-login-card > div:first-child + div > button,
  html[data-mh-host-signin="1"] .mh-login-cancel {
    background: transparent !important;
    color: #64748b !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    width: 100% !important;
    min-height: 40px !important;
    padding: 10px 18px !important;
    margin-top: 10px !important;
    font-size: 0.9rem !important;
    font-weight: 500 !important;
    box-shadow: none !important;
  }

  html.mh-host-login-open #authModal #forgotPwdLink,
  html.mh-host-login-open #authModal #resendHostSignupLink {
    font-size: 0.8125rem !important;
    color: #2563eb !important;
  }

  html.mh-host-login-open #authModal .mh-host-login-card > div:first-child + div > div:last-child,
  html[data-mh-host-signin="1"] .mh-login-foot {
    margin: 20px -36px 0 !important;
    padding: 18px 36px 0 !important;
    border-top: 1px solid #e2e8f0 !important;
    background: #ffffff !important;
    text-align: center !important;
  }

  html.mh-host-login-open #authModalBackBtn,
  html.mh-host-page body.mh-host-login-open #authModalBackBtn {
    top: 24px !important;
    right: 24px !important;
    height: 36px !important;
    padding: 0 14px !important;
    font-size: 0.8125rem !important;
    border-radius: 8px !important;
    background: #ffffff !important;
    color: #334155 !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06) !important;
  }
}
