/* ShiftNevis canonical mobile navigation v2 — global dock Back is the only visible back control. */
@media (max-width: 760px) {
  .onboarding-flow-nav,
  .unified-setup-flow-nav,
  .workflow-nav,
  .workflow-navigation,
  [data-workflow-nav],
  .program-flow-guide {
    display: none !important;
  }

  /* The persistent dock now owns Back. Keep forward actions, remove every
     competing local Back / previous-step control from the mobile UI. */
  .program-workflow-mobile-back,
  .profile-mobile-screen-head__back,
  .calendar-needs-mobile-back,
  .requests-mobile-back,
  .builder-mobile-canonical-back,
  .personnel-mobile-back,
  .personnel-mobile-detail__head > button[aria-label="بازگشت"],
  .requests-mobile-flow__back,
  .program-workflow-mobile-step-nav__btn--prev,
  [data-mobile-nav-action="workflow-hub"]:not(.mobile-app-dock__item) {
    display: none !important;
  }

  /* Existing module-specific previous buttons are redundant with global Back. */
  body.program-workflow-mobile-detail .calendar-needs-mobile-next,
  body.program-workflow-mobile-detail .personnel-mobile-requests,
  body.program-workflow-mobile-detail .requests-mobile-flow {
    display: none !important;
  }

  /* When a canonical next-stage CTA is generated, it occupies the whole row. */
  .program-workflow-mobile-step-nav {
    box-sizing: border-box;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin: 14px 0 2px;
    padding-top: 12px;
    border-top: 1px solid #ece5f4;
  }

  .program-workflow-mobile-step-nav:not(:has(.program-workflow-mobile-step-nav__btn--next)) {
    display: none !important;
  }

  .program-workflow-mobile-step-nav__spacer {
    display: none !important;
  }

  .program-workflow-mobile-step-nav__btn {
    appearance: none;
    box-sizing: border-box;
    min-width: 0;
    min-height: 54px;
    display: grid;
    grid-template-columns: 26px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 9px 10px;
    border: 1px solid #e2d8ee;
    border-radius: 14px;
    color: #554a65;
    background: #fff;
    box-shadow: 0 4px 13px rgba(46, 35, 65, .025);
    text-align: right;
    font: inherit;
    -webkit-tap-highlight-color: transparent;
  }

  .program-workflow-mobile-step-nav__btn:active {
    transform: scale(.988);
    border-color: #cdb9f5;
    background: #faf7ff;
  }

  .program-workflow-mobile-step-nav__btn > i {
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    color: #7c3aed;
    background: #f7f2ff;
    font-size: 9px;
  }

  .program-workflow-mobile-step-nav__btn > span {
    min-width: 0;
    display: grid;
    gap: 2px;
  }

  .program-workflow-mobile-step-nav__btn small,
  .program-workflow-mobile-step-nav__btn b {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .program-workflow-mobile-step-nav__btn small {
    color: #94899f;
    font-size: 7.5px;
    line-height: 1.3;
    font-weight: 800;
  }

  .program-workflow-mobile-step-nav__btn b {
    color: #2d2537;
    font-size: 10.5px;
    line-height: 1.45;
    font-weight: 950;
  }

  .program-workflow-mobile-step-nav__btn--next {
    grid-template-columns: minmax(0, 1fr) 26px;
    border-color: #d9c8f6;
    color: #fff;
    background: #7c3aed;
    box-shadow: 0 8px 18px rgba(124, 58, 237, .14);
  }

  .program-workflow-mobile-step-nav__btn--next > i {
    color: #fff;
    background: rgba(255, 255, 255, .16);
  }

  .program-workflow-mobile-step-nav__btn--next small {
    color: rgba(255, 255, 255, .72);
  }

  .program-workflow-mobile-step-nav__btn--next b {
    color: #fff;
  }

  /* Reflow headers after their local Back button is hidden. */
  .profile-mobile-screen-head {
    grid-template-columns: 44px minmax(0, 1fr) auto !important;
  }

  .profile-mobile-screen-head__badge {
    grid-column: auto !important;
  }
}

@media (max-width: 390px) {
  .program-workflow-mobile-step-nav {
    gap: 7px;
    margin-top: 12px;
    padding-top: 10px;
  }

  .program-workflow-mobile-step-nav__btn {
    min-height: 50px;
    gap: 7px;
    padding: 8px;
    border-radius: 13px;
  }

  .program-workflow-mobile-step-nav__btn b {
    font-size: 10px;
  }

  .profile-mobile-screen-head {
    grid-template-columns: 40px minmax(0, 1fr) !important;
  }

  .profile-mobile-screen-head__badge {
    grid-column: 1 / -1 !important;
    justify-self: start;
  }
}
