/*
 * ShiftNevis canonical mobile workspace bar.
 * Owns workspace context/switcher geometry on phone screens. Dashboard home has
 * its own compact summary treatment and is intentionally excluded here.
 */
@media (max-width: 760px) {
  body:not(:has(.dashboard-mobile-home)) .mobile-workspace-bar {
    box-sizing: border-box !important;
    width: calc(100% - 16px) !important;
    max-width: none !important;
    margin: 8px 8px 0 !important;
    padding: 10px !important;
    overflow: hidden !important;
    border: 1px solid #e3d8f4 !important;
    border-radius: 18px !important;
    background: linear-gradient(145deg, #ffffff 0%, #fbf9ff 100%) !important;
    box-shadow: 0 8px 24px rgba(45, 31, 73, 0.045) !important;
    direction: rtl !important;
  }

  body:not(:has(.dashboard-mobile-home)) .mobile-workspace-bar__head {
    display: grid !important;
    grid-template-columns: 42px minmax(0, 1fr) 36px !important;
    align-items: center !important;
    gap: 9px !important;
    min-width: 0 !important;
  }

  body:not(:has(.dashboard-mobile-home)) .mobile-workspace-bar__icon {
    box-sizing: border-box !important;
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    display: grid !important;
    place-items: center !important;
    overflow: hidden !important;
    padding: 0 !important;
    border: 1px solid #e1d6f4 !important;
    border-radius: 13px !important;
    color: #6d28d9 !important;
    background: #f1eaff !important;
    font-size: 15px !important;
  }

  body:not(:has(.dashboard-mobile-home)) .mobile-workspace-bar__icon.has-logo {
    padding: 3px !important;
    background: #fff !important;
  }

  body:not(:has(.dashboard-mobile-home)) .mobile-workspace-bar__icon img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    border-radius: 9px !important;
  }

  body:not(:has(.dashboard-mobile-home)) .mobile-workspace-bar__head > div {
    min-width: 0 !important;
    display: grid !important;
    gap: 2px !important;
  }

  body:not(:has(.dashboard-mobile-home)) .mobile-workspace-bar__head small {
    display: block !important;
    color: #7c3aed !important;
    font-size: 8px !important;
    line-height: 1.35 !important;
    font-weight: 900 !important;
  }

  body:not(:has(.dashboard-mobile-home)) .mobile-workspace-bar__head b {
    display: block !important;
    min-width: 0 !important;
    overflow: hidden !important;
    color: #251d30 !important;
    font-size: 11.5px !important;
    line-height: 1.45 !important;
    font-weight: 950 !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  body:not(:has(.dashboard-mobile-home)) .mobile-workspace-bar__head span:not(.mobile-workspace-bar__icon) {
    display: block !important;
    min-width: 0 !important;
    overflow: hidden !important;
    color: #82788e !important;
    font-size: 8.5px !important;
    line-height: 1.4 !important;
    font-weight: 750 !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  body:not(:has(.dashboard-mobile-home)) .mobile-workspace-bar__manage {
    box-sizing: border-box !important;
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    display: grid !important;
    place-items: center !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 1px solid #e2d7f3 !important;
    border-radius: 11px !important;
    color: #6d28d9 !important;
    background: #f7f2ff !important;
    font-size: 12px !important;
  }

  body:not(:has(.dashboard-mobile-home)) .mobile-owner-row {
    box-sizing: border-box !important;
    min-width: 0 !important;
    display: grid !important;
    grid-template-columns: 28px minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 7px !important;
    margin: 8px 0 0 !important;
    padding: 7px 8px !important;
    border: 1px solid #eee8f4 !important;
    border-radius: 11px !important;
    color: #645b70 !important;
    background: #fcfbfd !important;
  }

  body:not(:has(.dashboard-mobile-home)) .mobile-owner-row > i {
    width: 28px !important;
    height: 28px !important;
    display: grid !important;
    place-items: center !important;
    border-radius: 9px !important;
    color: #6d28d9 !important;
    background: #f2ecff !important;
    font-size: 10px !important;
  }

  body:not(:has(.dashboard-mobile-home)) .mobile-owner-row > span {
    min-width: 0 !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: center !important;
    gap: 8px !important;
  }

  body:not(:has(.dashboard-mobile-home)) .mobile-owner-row b,
  body:not(:has(.dashboard-mobile-home)) .mobile-owner-row small {
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  body:not(:has(.dashboard-mobile-home)) .mobile-owner-row b {
    font-size: 8.5px !important;
    font-weight: 900 !important;
  }

  body:not(:has(.dashboard-mobile-home)) .mobile-owner-row small {
    color: #918899 !important;
    font-size: 7.5px !important;
    font-weight: 750 !important;
  }

  body:not(:has(.dashboard-mobile-home)) .mobile-workspace-bar__select {
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 0 !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 6px !important;
    align-items: stretch !important;
    margin: 9px 0 0 !important;
    padding: 9px 0 0 !important;
    border-top: 1px solid #eee8f4 !important;
  }

  body:not(:has(.dashboard-mobile-home)) .mobile-workspace-bar__select > span {
    display: block !important;
    margin: 0 !important;
    color: #665b74 !important;
    font-size: 8.5px !important;
    line-height: 1.35 !important;
    font-weight: 900 !important;
  }

  body:not(:has(.dashboard-mobile-home)) .mobile-workspace-bar__select > select.select {
    box-sizing: border-box !important;
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: 46px !important;
    min-height: 46px !important;
    margin: 0 !important;
    padding: 0 13px 0 42px !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    border: 1px solid #ded3ed !important;
    border-radius: 14px !important;
    color: #2d2537 !important;
    background-color: #fff !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 20 20'%3E%3Cpath d='M5 7.5l5 5 5-5' fill='none' stroke='%236d5a84' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-size: 16px 16px !important;
    background-position: left 14px center !important;
    box-shadow: 0 3px 10px rgba(58, 38, 86, 0.025) !important;
    font-family: var(--font) !important;
    font-size: 16px !important;
    line-height: 1.2 !important;
    font-weight: 800 !important;
    direction: rtl !important;
    text-align: right !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  body:not(:has(.dashboard-mobile-home)) .mobile-workspace-bar__select > select.select:focus {
    outline: none !important;
    border-color: #b99bea !important;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.08) !important;
  }

  /* On the profile screen the owner data is already a first-class card below,
     so repeating it in the workspace bar only makes the iPhone header taller. */
  body:has(.profile-mobile-app) .mobile-owner-row {
    display: none !important;
  }

  @media (max-width: 390px) {
    body:not(:has(.dashboard-mobile-home)) .mobile-workspace-bar {
      width: calc(100% - 12px) !important;
      margin: 6px 6px 0 !important;
      padding: 9px !important;
      border-radius: 16px !important;
    }

    body:not(:has(.dashboard-mobile-home)) .mobile-workspace-bar__head {
      grid-template-columns: 38px minmax(0, 1fr) 34px !important;
      gap: 7px !important;
    }

    body:not(:has(.dashboard-mobile-home)) .mobile-workspace-bar__icon {
      width: 38px !important;
      height: 38px !important;
      min-width: 38px !important;
    }

    body:not(:has(.dashboard-mobile-home)) .mobile-workspace-bar__manage {
      width: 34px !important;
      height: 34px !important;
      min-width: 34px !important;
    }

    body:not(:has(.dashboard-mobile-home)) .mobile-workspace-bar__select > select.select {
      height: 44px !important;
      min-height: 44px !important;
      padding-left: 38px !important;
      background-position: left 12px center !important;
    }
  }
}

/* Dashboard home: use the same useful workspace controls as the full mobile card
   instead of the old duplicate compact center/department strip. */
@media (max-width: 760px) {
  body:has(.dashboard-mobile-home) .mobile-workspace-bar {
    box-sizing: border-box !important;
    width: calc(100% - 16px) !important;
    max-width: none !important;
    margin: 8px 8px 0 !important;
    padding: 10px !important;
    overflow: hidden !important;
    border: 1px solid #e3d8f4 !important;
    border-radius: 18px !important;
    background: linear-gradient(145deg, #ffffff 0%, #fbf9ff 100%) !important;
    box-shadow: 0 8px 24px rgba(45, 31, 73, 0.045) !important;
    direction: rtl !important;
  }

  body:has(.dashboard-mobile-home) .mobile-workspace-bar__head {
    display: grid !important;
    grid-template-columns: 42px minmax(0, 1fr) 36px !important;
    align-items: center !important;
    gap: 9px !important;
    min-width: 0 !important;
  }

  body:has(.dashboard-mobile-home) .mobile-workspace-bar__icon {
    box-sizing: border-box !important;
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    display: grid !important;
    place-items: center !important;
    overflow: hidden !important;
    padding: 0 !important;
    border: 1px solid #e1d6f4 !important;
    border-radius: 13px !important;
    color: #6d28d9 !important;
    background: #f1eaff !important;
    font-size: 15px !important;
  }

  body:has(.dashboard-mobile-home) .mobile-workspace-bar__icon.has-logo {
    padding: 3px !important;
    background: #fff !important;
  }

  body:has(.dashboard-mobile-home) .mobile-workspace-bar__icon img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    border-radius: 9px !important;
  }

  body:has(.dashboard-mobile-home) .mobile-workspace-bar__head > div {
    min-width: 0 !important;
    display: grid !important;
    gap: 2px !important;
  }

  body:has(.dashboard-mobile-home) .mobile-workspace-bar__head small {
    display: block !important;
    color: #7c3aed !important;
    font-size: 8px !important;
    line-height: 1.35 !important;
    font-weight: 900 !important;
  }

  body:has(.dashboard-mobile-home) .mobile-workspace-bar__head b {
    display: block !important;
    min-width: 0 !important;
    overflow: hidden !important;
    color: #251d30 !important;
    font-size: 11.5px !important;
    line-height: 1.45 !important;
    font-weight: 950 !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  body:has(.dashboard-mobile-home) .mobile-workspace-bar__head b::after {
    content: none !important;
  }

  body:has(.dashboard-mobile-home) .mobile-workspace-bar__head span:not(.mobile-workspace-bar__icon) {
    display: block !important;
    min-width: 0 !important;
    overflow: hidden !important;
    color: #82788e !important;
    font-size: 8.5px !important;
    line-height: 1.4 !important;
    font-weight: 750 !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  body:has(.dashboard-mobile-home) .mobile-workspace-bar__manage {
    box-sizing: border-box !important;
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    display: grid !important;
    place-items: center !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 1px solid #e2d7f3 !important;
    border-radius: 11px !important;
    color: #6d28d9 !important;
    background: #f7f2ff !important;
    font-size: 12px !important;
  }

  body:has(.dashboard-mobile-home) .mobile-owner-row {
    box-sizing: border-box !important;
    min-width: 0 !important;
    display: grid !important;
    grid-template-columns: 28px minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 7px !important;
    margin: 8px 0 0 !important;
    padding: 7px 8px !important;
    border: 1px solid #eee8f4 !important;
    border-radius: 11px !important;
    color: #645b70 !important;
    background: #fcfbfd !important;
  }

  body:has(.dashboard-mobile-home) .mobile-owner-row > i {
    width: 28px !important;
    height: 28px !important;
    display: grid !important;
    place-items: center !important;
    border-radius: 9px !important;
    color: #6d28d9 !important;
    background: #f2ecff !important;
    font-size: 10px !important;
  }

  body:has(.dashboard-mobile-home) .mobile-owner-row > span {
    min-width: 0 !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: center !important;
    gap: 8px !important;
  }

  body:has(.dashboard-mobile-home) .mobile-owner-row b,
  body:has(.dashboard-mobile-home) .mobile-owner-row small {
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  body:has(.dashboard-mobile-home) .mobile-owner-row b {
    font-size: 8.5px !important;
    font-weight: 900 !important;
  }

  body:has(.dashboard-mobile-home) .mobile-owner-row small {
    color: #918899 !important;
    font-size: 7.5px !important;
    font-weight: 750 !important;
  }

  body:has(.dashboard-mobile-home) .mobile-workspace-bar__select {
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 0 !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 6px !important;
    align-items: stretch !important;
    margin: 9px 0 0 !important;
    padding: 9px 0 0 !important;
    border-top: 1px solid #eee8f4 !important;
  }

  body:has(.dashboard-mobile-home) .mobile-workspace-bar__select > span {
    display: block !important;
    margin: 0 !important;
    color: #665b74 !important;
    font-size: 8.5px !important;
    line-height: 1.35 !important;
    font-weight: 900 !important;
  }

  body:has(.dashboard-mobile-home) .mobile-workspace-bar__select > select.select {
    box-sizing: border-box !important;
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: 46px !important;
    min-height: 46px !important;
    margin: 0 !important;
    padding: 0 13px 0 42px !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    border: 1px solid #ded3ed !important;
    border-radius: 14px !important;
    color: #2d2537 !important;
    background-color: #fff !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 20 20'%3E%3Cpath d='M5 7.5l5 5 5-5' fill='none' stroke='%236d5a84' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-size: 16px 16px !important;
    background-position: left 14px center !important;
    box-shadow: 0 3px 10px rgba(58, 38, 86, 0.025) !important;
    font-family: var(--font) !important;
    font-size: 16px !important;
    line-height: 1.2 !important;
    font-weight: 800 !important;
    direction: rtl !important;
    text-align: right !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  body:has(.dashboard-mobile-home) .mobile-workspace-bar__select > select.select:focus {
    outline: none !important;
    border-color: #b99bea !important;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.08) !important;
  }

  /* The gear is useful on dashboard because it opens workspace management.
     On the profile screen it points to the page the user is already on, so hide it. */
  body:has(.profile-mobile-app) .mobile-workspace-bar__manage {
    display: none !important;
  }

  body:has(.profile-mobile-app) .mobile-workspace-bar__head {
    grid-template-columns: 42px minmax(0, 1fr) !important;
  }
}

@media (max-width: 390px) {
  body:has(.dashboard-mobile-home) .mobile-workspace-bar {
    width: calc(100% - 12px) !important;
    margin: 6px 6px 0 !important;
    padding: 9px !important;
    border-radius: 16px !important;
  }

  body:has(.dashboard-mobile-home) .mobile-workspace-bar__head {
    grid-template-columns: 38px minmax(0, 1fr) 34px !important;
    gap: 7px !important;
  }

  body:has(.dashboard-mobile-home) .mobile-workspace-bar__icon {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
  }

  body:has(.dashboard-mobile-home) .mobile-workspace-bar__manage {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
  }

  body:has(.dashboard-mobile-home) .mobile-workspace-bar__select > select.select {
    height: 44px !important;
    min-height: 44px !important;
    padding-left: 38px !important;
    background-position: left 12px center !important;
  }

  body:has(.profile-mobile-app) .mobile-workspace-bar__head {
    grid-template-columns: 38px minmax(0, 1fr) !important;
  }
}
