.marketplace-scope {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: auto;
  padding: 4px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}

.marketplace-scope button {
  position: relative;
  min-height: 36px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  border-radius: 9px;
  color: #667085;
  background: transparent;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  transition: background .16s ease, color .16s ease, box-shadow .16s ease;
}

.marketplace-scope button:hover:not(:disabled) {
  color: #111827;
  background: #f8fafc;
}

.marketplace-scope button.active {
  color: #111827;
  background: #fff;
  box-shadow: 0 1px 3px rgba(16, 24, 40, .12);
}

.marketplace-scope button.loading {
  color: #344054;
  background: #f8fafc;
}

.marketplace-scope button.loading::after {
  content: '';
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border: 2px solid #d0d5dd;
  border-top-color: #1265e8;
  border-radius: 999px;
  animation: marketplace-scope-spin .8s linear infinite;
}

.marketplace-scope button:disabled {
  cursor: default;
  opacity: .48;
}

.marketplace-scope button > i {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 6px;
  height: 6px;
  border: 1px solid #fff;
  border-radius: 999px;
  background: #f59e0b;
}

.marketplace-scope-mark {
  width: 21px;
  height: 21px;
  display: inline-grid;
  place-items: center;
  border-radius: 7px;
  color: #fff;
  background: #475467;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: -.02em;
}

.marketplace-scope-mark.kaspi,
.store-logo.kaspi,
.marketplace-order-badge.kaspi b {
  background: #d9272e;
}

.marketplace-scope-mark.ozon,
.store-logo.ozon,
.marketplace-order-badge.ozon b {
  background: #1265e8;
}

.marketplace-scope-mark.all,
.store-logo.all {
  background: #111827;
}

.dashboard-head,
.orders-view-head {
  gap: 14px;
}

.dashboard-head > .marketplace-scope,
.orders-view-head > .marketplace-scope {
  flex: 0 0 auto;
}

.workspace-logo.multi-marketplace {
  width: 42px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: #f2f4f7;
}

.workspace-logo.multi-marketplace > span {
  width: 17px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: #fff;
  font-size: 8px;
  font-weight: 900;
}

.workspace-logo.multi-marketplace > .kaspi { background: #d9272e; }
.workspace-logo.multi-marketplace > .ozon { background: #1265e8; }

.marketplace-order-badge {
  margin-top: 5px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #667085;
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.marketplace-order-badge b {
  width: 17px;
  height: 17px;
  display: inline-grid;
  place-items: center;
  border-radius: 5px;
  color: #fff;
  font-size: 8px;
  font-weight: 900;
}

.marketplace-connection-summary {
  white-space: nowrap;
}

@keyframes marketplace-scope-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .marketplace-scope button.loading::after {
    animation: none;
  }
}

@media (max-width: 900px) {
  .dashboard-head,
  .orders-view-head {
    flex-wrap: wrap;
  }

  .dashboard-head > .marketplace-scope,
  .orders-view-head > .marketplace-scope {
    order: 3;
    width: 100%;
    margin: 0;
  }

  .marketplace-scope button {
    flex: 1 1 0;
    justify-content: center;
  }
}

@media (max-width: 520px) {
  .marketplace-scope-label {
    display: none;
  }

  .marketplace-scope button {
    min-height: 38px;
    padding: 0 12px;
  }

  .marketplace-scope-mark {
    width: 24px;
    height: 24px;
  }

  .marketplace-order-badge span {
    display: none;
  }
}
