/* ShiftNevis mobile/tablet app dock v4 — canonical app navigation. */
@media (max-width: 1024px) {
  body.mobile-app-dock-mounted {
    --mobile-app-dock-height: 76px;
    --mobile-app-safe-bottom: env(safe-area-inset-bottom, 0px);
  }

  /* The sidebar remains in DOM as the canonical menu source, but is no longer a visual footer. */
  body.mobile-app-dock-mounted .app > .sidebar {
    display: none !important;
  }

  body.mobile-app-dock-mounted .main {
    padding-bottom: calc(var(--mobile-app-dock-height) + var(--mobile-app-safe-bottom) + 20px) !important;
  }

  body.mobile-app-dock-mounted .dashboard-footer,
  body.mobile-app-dock-mounted .back-to-top {
    display: none !important;
  }

  .mobile-app-dock-root {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 8500;
    pointer-events: none;
    font-family: var(--font, inherit);
    direction: rtl;
  }

  .mobile-app-dock {
    pointer-events: auto;
    box-sizing: border-box;
    min-height: calc(72px + env(safe-area-inset-bottom, 0px));
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: end;
    gap: 2px;
    padding: 7px 8px calc(6px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid rgba(216, 207, 230, 0.9);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 -12px 30px rgba(43, 32, 61, 0.08);
    backdrop-filter: blur(18px) saturate(1.25);
    -webkit-backdrop-filter: blur(18px) saturate(1.25);
  }

  .mobile-app-dock__item {
    appearance: none;
    position: relative;
    min-width: 0;
    height: 58px;
    display: grid;
    grid-template-rows: 32px 16px;
    place-items: center;
    align-content: center;
    gap: 1px;
    padding: 3px 2px;
    border: 0;
    border-radius: 15px;
    color: #756b80;
    background: transparent;
    font: inherit;
    -webkit-tap-highlight-color: transparent;
    transition: color .14s ease, background .14s ease, transform .14s ease;
  }

  .mobile-app-dock__item:active {
    transform: scale(.96);
    background: #f7f3fb;
  }

  .mobile-app-dock__icon {
    width: 31px;
    height: 31px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    color: #756b80;
    background: #f6f3f8;
    font-size: 13px;
    transition: color .14s ease, background .14s ease, box-shadow .14s ease;
  }

  .mobile-app-dock__label {
    max-width: 100%;
    overflow: hidden;
    color: inherit;
    font-size: 8.5px;
    line-height: 1.2;
    font-weight: 850;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-app-dock__item.is-active {
    color: #6d28d9;
    background: #faf7ff;
  }

  .mobile-app-dock__item.is-active .mobile-app-dock__icon {
    color: #6d28d9;
    background: #eee6ff;
    box-shadow: inset 0 0 0 1px rgba(124, 58, 237, .06);
  }

  .mobile-app-dock__item--primary {
    margin-top: -18px;
    height: 70px;
    grid-template-rows: 44px 17px;
    overflow: visible;
  }

  .mobile-app-dock__item--primary .mobile-app-dock__icon {
    width: 44px;
    height: 44px;
    border-radius: 15px;
    color: #fff;
    background: linear-gradient(145deg, #8b4df4, #6d28d9);
    box-shadow: 0 9px 20px rgba(109, 40, 217, .24), 0 0 0 5px rgba(255,255,255,.96);
    font-size: 16px;
  }

  .mobile-app-dock__item--primary .mobile-app-dock__label {
    color: #4d405a;
    font-size: 8.5px;
    font-weight: 950;
  }

  .mobile-app-dock__item--primary.is-active {
    background: transparent;
  }

  .mobile-app-dock__item--primary.is-active .mobile-app-dock__icon {
    color: #fff;
    background: linear-gradient(145deg, #8b4df4, #6d28d9);
    box-shadow: 0 10px 24px rgba(109, 40, 217, .3), 0 0 0 5px rgba(245,240,255,.98);
  }

  .mobile-app-dock__item--primary.is-active .mobile-app-dock__label {
    color: #6d28d9;
  }

  .mobile-app-dock-backdrop {
    pointer-events: none;
    position: fixed;
    inset: 0;
    z-index: -2;
    opacity: 0;
    background: rgba(31, 23, 42, .26);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    transition: opacity .2s ease;
  }

  .mobile-app-more-sheet {
    pointer-events: none;
    box-sizing: border-box;
    position: fixed;
    z-index: -1;
    right: 10px;
    left: 10px;
    bottom: calc(72px + env(safe-area-inset-bottom, 0px) + 7px);
    width: auto;
    max-width: 760px;
    max-height: min(72vh, 660px);
    margin-inline: auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #e1d7ec;
    border-radius: 24px;
    background: rgba(255,255,255,.985);
    box-shadow: 0 24px 70px rgba(34, 24, 48, .2);
    opacity: 0;
    transform: translateY(18px) scale(.985);
    transform-origin: bottom center;
    transition: opacity .2s ease, transform .22s cubic-bezier(.2,.8,.2,1);
  }

  .mobile-app-dock-root.is-more-open .mobile-app-dock-backdrop {
    pointer-events: auto;
    z-index: 0;
    opacity: 1;
  }

  .mobile-app-dock-root.is-more-open .mobile-app-more-sheet {
    pointer-events: auto;
    z-index: 1;
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  body.mobile-app-more-open {
    overflow: hidden;
  }

  .mobile-app-more-sheet__handle {
    width: 36px;
    height: 4px;
    flex: 0 0 auto;
    margin: 8px auto 3px;
    border-radius: 999px;
    background: #ddd4e5;
  }

  .mobile-app-more-sheet__head {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 14px 11px;
    border-bottom: 1px solid #eee8f2;
  }

  .mobile-app-more-sheet__head > div {
    min-width: 0;
  }

  .mobile-app-more-sheet__head small {
    display: block;
    color: #7c3aed;
    font-size: 8px;
    font-weight: 900;
  }

  .mobile-app-more-sheet__head h2 {
    margin: 1px 0 0;
    color: #282031;
    font-size: 16px;
    line-height: 1.45;
    font-weight: 950;
  }

  .mobile-app-more-sheet__head p {
    margin: 1px 0 0;
    color: #8a8094;
    font-size: 8.5px;
    line-height: 1.5;
    font-weight: 700;
  }

  .mobile-app-more-sheet__close {
    appearance: none;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border: 1px solid #e5ddeb;
    border-radius: 12px;
    color: #675d72;
    background: #faf8fc;
    font-size: 12px;
  }

  .mobile-app-more-sheet__body {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 10px 11px 14px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .mobile-app-more-sheet__body::-webkit-scrollbar { display: none; }

  .mobile-app-more-group + .mobile-app-more-group {
    margin-top: 12px;
    padding-top: 11px;
    border-top: 1px solid #eee8f2;
  }

  .mobile-app-more-group__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0 3px 7px;
  }

  .mobile-app-more-group__head b {
    color: #51475d;
    font-size: 9px;
    font-weight: 900;
  }

  .mobile-app-more-group__head span {
    min-width: 24px;
    height: 22px;
    display: grid;
    place-items: center;
    padding: 0 6px;
    border-radius: 999px;
    color: #7c3aed;
    background: #f2ecff;
    font-size: 8px;
    font-weight: 900;
  }

  .mobile-app-more-group__list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .mobile-app-more-item {
    appearance: none;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    min-height: 58px;
    display: grid;
    grid-template-columns: 42px minmax(0,1fr) 24px;
    align-items: center;
    gap: 9px;
    padding: 8px 9px;
    border: 1px solid #e8e1ed;
    border-radius: 15px;
    color: #302737;
    background: linear-gradient(145deg,#fff,#fdfbff);
    text-align: right;
    font: inherit;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-app-more-item:active {
    background: #f8f4fc;
    border-color: #d7c9e4;
    transform: scale(.992);
  }

  .mobile-app-more-item__icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    color: #6d28d9;
    background: #f0e8ff;
    font-size: 14px;
  }

  .mobile-app-more-item__copy {
    min-width: 0;
    display: grid;
    gap: 2px;
  }

  .mobile-app-more-item__copy b,
  .mobile-app-more-item__copy small {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-app-more-item__copy b {
    color: #2d2435;
    font-size: 10.5px;
    line-height: 1.45;
    font-weight: 950;
  }

  .mobile-app-more-item__copy small {
    color: #8e8498;
    font-size: 8px;
    line-height: 1.45;
    font-weight: 700;
  }

  .mobile-app-more-item__arrow {
    justify-self: center;
    color: #a397ae;
    font-size: 9px;
  }

  .mobile-app-more-item.is-management {
    border-color: #e6dcf4;
    background: #fcfaff;
  }

  .mobile-app-more-item.is-management .mobile-app-more-item__icon {
    color: #5c467a;
    background: #f1ecf7;
  }

  .mobile-app-more-empty {
    min-height: 84px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #8d8398;
    font-size: 9px;
    font-weight: 800;
  }

  @media (min-width: 430px) {
    .mobile-app-more-group__list {
      grid-template-columns: repeat(2, minmax(0,1fr));
    }
  }

  @media (max-width: 360px) {
    .mobile-app-dock {
      padding-inline: 4px;
      gap: 0;
    }
    .mobile-app-dock__label { font-size: 7.8px; }
    .mobile-app-dock__icon { width: 29px; height: 29px; }
    .mobile-app-dock__item--primary .mobile-app-dock__icon { width: 42px; height: 42px; }
  }
}

@media (min-width: 1025px) {
  .mobile-app-dock-root { display: none !important; }
}
