/* Reused from packages/design-system/src/components/Dropdown/Dropdown.css.
   The components layer is flattened for this standalone page. */
.dropdown {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: var(--space-100);
  width: max-content;
  padding: var(--space-200);
  border: 0;
  border-radius: var(--radius-400);
  background: var(--color-bg-surface);
  box-shadow:
    inset 0 0 0 var(--stroke-border) var(--color-border-default),
    var(--elevation-medium);
}

.dropdown--scroll {
  max-height: 401px;
  overflow: auto;
}

.dropdown--scroll::-webkit-scrollbar {
  width: 6px;
}

.dropdown--scroll::-webkit-scrollbar-track {
  margin-block: var(--space-200);
  background: transparent;
}

.dropdown--scroll::-webkit-scrollbar-thumb {
  border-radius: var(--radius-full);
  background: var(--color-scrollbar-thumb);
}

.dropdown-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-100);
  width: 100%;
}

.dropdown-group__header {
  box-sizing: border-box;
  display: flex;
  flex: none;
  align-items: center;
  gap: var(--space-200);
  width: 100%;
  min-height: 16px;
  padding: var(--space-200) var(--space-100);
}

.dropdown-group__tag {
  flex: none;
  color: var(--color-text-tertiary);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
  white-space: nowrap;
}

.dropdown-group__line {
  flex: 1 0 0;
  min-width: 1px;
  height: 1px;
  background: var(--color-border-subtle);
}

.dropdown-item {
  box-sizing: border-box;
  display: flex;
  flex: none;
  align-items: center;
  gap: var(--space-200);
  width: 100%;
  min-height: 44px;
  padding: var(--space-200) var(--space-300);
  border: 0;
  border-radius: var(--radius-200);
  background: transparent;
  color: var(--color-text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  text-align: left;
  cursor: pointer;
}

.dropdown-item--sm {
  font-size: var(--font-size-caption, 12px);
  line-height: var(--line-height-caption, 16px);
}

.dropdown-item--plain {
  justify-content: center;
  text-align: center;
}

.dropdown-item--plain .dropdown-item__copy,
.dropdown-item--plain .dropdown-item__label {
  flex: 0 1 auto;
}

.dropdown-item--single,
.dropdown-item--multiple {
  font-weight: 500;
}

.dropdown-item:hover:not(:disabled):not(.is-selected),
.dropdown-item.is-hovered:not(:disabled):not(.is-selected) {
  background: var(--color-bg-hover);
}

.dropdown-item:active:not(:disabled):not(.is-selected),
.dropdown-item.is-pressed:not(:disabled):not(.is-selected) {
  background: var(--color-bg-selected);
}

.dropdown-item.is-selected {
  background: var(--color-bg-brand-subtle);
  color: var(--color-text-brand);
}

.dropdown-item.is-selected:hover:not(:disabled),
.dropdown-item.is-selected.is-hovered:not(:disabled) {
  background: var(--color-bg-brand-subtle-hover);
}

.dropdown-item:disabled {
  color: var(--color-text-disabled);
  cursor: not-allowed;
}

.dropdown-item__leading,
.dropdown-item__trailing,
.dropdown-item__control {
  display: grid;
  flex: none;
  place-items: center;
  width: var(--icon-xs);
  height: var(--icon-xs);
  color: var(--color-icon-default);
}

.dropdown-item.is-selected .dropdown-item__leading,
.dropdown-item.is-selected .dropdown-item__trailing {
  color: var(--color-icon-brand);
}

.dropdown-item__leading svg,
.dropdown-item__trailing svg,
.dropdown-item__control svg {
  display: block;
}

.dropdown-item__copy {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: var(--space-200);
  min-width: 0;
}

.dropdown-item__label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropdown-item__description {
  flex: none;
  color: var(--color-text-secondary);
  font-weight: 400;
  white-space: nowrap;
}

.dropdown-item.is-selected .dropdown-item__description {
  color: inherit;
}

.dropdown-item__control {
  box-sizing: border-box;
  border: var(--stroke-border) solid var(--color-border-default);
  background: var(--color-bg-surface);
}

.dropdown-item__control--multiple {
  border-radius: var(--radius-100);
}

.dropdown-item__control--single {
  border-radius: var(--radius-full);
}

.dropdown-item__control.is-checked {
  border-color: var(--color-border-brand);
  background: var(--color-bg-brand);
}

.dropdown-item.is-selected:hover:not(:disabled)
  .dropdown-item__control.is-checked,
.dropdown-item.is-selected.is-hovered:not(:disabled)
  .dropdown-item__control.is-checked {
  border-color: var(--color-border-brand-hover);
  background: var(--color-bg-brand-hover);
}

.dropdown-item__control--multiple path {
  fill: none;
  stroke: var(--color-icon-inverse);
  stroke-width: var(--stroke-focus-ring);
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dropdown-item__control--single.is-checked::after {
  width: var(--space-150);
  height: var(--space-150);
  border-radius: var(--radius-full);
  background: var(--color-icon-inverse);
  content: "";
}

.dropdown-item:focus-visible {
  outline: var(--stroke-focus-ring) solid var(--color-border-strong);
  outline-offset: calc(var(--stroke-focus-ring) * -1);
}
