.ds-scope *,
.ds-scope *::before,
.ds-scope *::after {
  box-sizing: border-box;
}

.ds-button,
.ds-icon-button {
  appearance: none;
  min-height: var(--ds-control-height);
  border: 1px solid var(--ds-line);
  border-radius: var(--ds-radius-md);
  background: var(--ds-surface);
  color: var(--ds-text);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  transition:
    background var(--ds-motion-fast) var(--ds-ease),
    border-color var(--ds-motion-fast) var(--ds-ease),
    transform var(--ds-motion-fast) var(--ds-ease);
}

.ds-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 15px;
}

.ds-icon-button {
  width: var(--ds-control-height);
  min-width: var(--ds-control-height);
  display: inline-grid;
  place-items: center;
}

.ds-button:hover,
.ds-icon-button:hover {
  background: var(--ds-fill-hover);
  border-color: var(--ds-line-strong);
}

.ds-button:active,
.ds-icon-button:active {
  transform: scale(.985);
}

.ds-button--primary {
  border-color: transparent;
  background: var(--ds-accent);
  color: white;
}

.ds-button--primary:hover {
  background: var(--ds-accent-hover);
  border-color: transparent;
}

.ds-scope button:focus-visible,
.ds-scope input:focus-visible,
.ds-scope select:focus-visible {
  outline: 3px solid color-mix(
    in srgb,
    var(--ds-accent) 28%,
    transparent
  );
  outline-offset: 2px;
}

.ds-search {
  position: relative;
  display: flex;
  align-items: center;
}

.ds-search input {
  width: 100%;
  height: var(--ds-control-height);
  padding: 0 14px 0 38px;
  border: 1px solid var(--ds-line);
  border-radius: var(--ds-radius-md);
  background: var(--ds-fill);
  color: var(--ds-text);
  font: inherit;
  font-size: 13px;
  transition:
    background var(--ds-motion-fast),
    border-color var(--ds-motion-fast);
}

.ds-search input::placeholder {
  color: var(--ds-text-tertiary);
}

.ds-search input:focus {
  background: var(--ds-surface);
  border-color: color-mix(
    in srgb,
    var(--ds-accent) 55%,
    var(--ds-line)
  );
}

.ds-search__icon {
  position: absolute;
  left: 13px;
  pointer-events: none;
  color: var(--ds-text-secondary);
  font-size: 15px;
}

.ds-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  gap: 6px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--ds-fill);
  color: var(--ds-text-secondary);
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

.ds-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
}

.ds-badge--success {
  color: var(--ds-success);
  background: var(--ds-success-soft);
}

.ds-badge--warning {
  color: var(--ds-warning);
  background: var(--ds-warning-soft);
}

.ds-badge--danger {
  color: var(--ds-danger);
  background: var(--ds-danger-soft);
}

.ds-card {
  border: 1px solid var(--ds-line);
  border-radius: var(--ds-radius-lg);
  background: var(--ds-surface);
  box-shadow: var(--ds-shadow-sm);
}

.ds-segmented {
  display: inline-flex;
  min-height: 38px;
  padding: 3px;
  gap: 2px;
  border-radius: 10px;
  background: var(--ds-fill);
}

.ds-segmented button {
  appearance: none;
  min-height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ds-text-secondary);
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.ds-segmented button.active {
  background: var(--ds-surface);
  color: var(--ds-text);
  box-shadow: var(--ds-shadow-sm);
}

.ds-empty {
  display: grid;
  place-items: center;
  min-height: 160px;
  padding: 30px;
  text-align: center;
  color: var(--ds-text-secondary);
}

.ds-empty b {
  color: var(--ds-text);
  font-size: 14px;
}

.ds-empty span {
  margin-top: 5px;
  max-width: 340px;
  font-size: 12px;
  line-height: 1.5;
}

@media (prefers-reduced-motion: reduce) {
  .ds-scope *,
  .ds-scope *::before,
  .ds-scope *::after {
    scroll-behavior: auto !important;
    transition-duration: 0ms !important;
    animation-duration: 0ms !important;
  }
}
