/* === DATASET SWITCHER === */

.ds-switcher {
  display: inline-block;
  position: relative;
}

.ds-switcher__trigger {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 6px var(--space-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: 8px;
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.ds-switcher__trigger:hover {
  border-color: var(--color-accent);
  background: var(--color-surface-raised);
}

.ds-switcher__label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-dim);
}

.ds-switcher__name {
  font-weight: 500;
  color: var(--color-accent);
}

.ds-switcher__caret {
  color: var(--color-text-muted);
  font-size: 0.7rem;
  margin-left: 2px;
}

/* === MENU === */
.ds-switcher__menu {
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border-strong);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  padding: var(--space-xs);
  display: flex;
  flex-direction: column;
  max-height: 70vh;
  overflow: hidden;
  animation: dsSwitcherIn 140ms ease-out;
}

@keyframes dsSwitcherIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.ds-switcher__list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ds-switcher__item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: stretch;
  gap: 2px;
  border-radius: 6px;
  overflow: hidden;
}

.ds-switcher__item:hover {
  background: var(--color-surface-hover);
}

.ds-switcher__item--active {
  background: var(--color-accent-dim);
}

.ds-switcher__item--active .ds-switcher__item-name {
  color: var(--color-accent);
  font-weight: 500;
}

.ds-switcher__select {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: transparent;
  border: none;
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 0.85rem;
  text-align: left;
  cursor: pointer;
  width: 100%;
}

.ds-switcher__item-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ds-switcher__item-count {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--color-text-dim);
  padding: 1px 6px;
  background: var(--color-bg);
  border-radius: 4px;
  flex-shrink: 0;
}

.ds-switcher__edit,
.ds-switcher__delete {
  background: transparent;
  border: none;
  color: var(--color-text-dim);
  cursor: pointer;
  padding: 0 8px;
  font-size: 0.85rem;
  transition: all var(--transition-fast);
}

.ds-switcher__edit:hover {
  color: var(--color-accent);
}

.ds-switcher__delete:hover:not(:disabled) {
  color: var(--mix-jaws);
}

.ds-switcher__delete:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.ds-switcher__footer {
  border-top: 1px solid var(--color-border);
  margin-top: 4px;
  padding-top: 4px;
}

.ds-switcher__new {
  display: block;
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  background: transparent;
  border: 1px dashed var(--color-border-strong);
  border-radius: 6px;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.ds-switcher__new:hover {
  border-color: var(--color-accent);
  border-style: solid;
  color: var(--color-accent);
}
