/* SelectControl — the app's value-picker disclosure (replaces native <select>;
   arch 10 §5). Trigger + panel mirror SortControl's geometry and tokens: the
   32px compact control height (arch 09 §6), value text at the option size. */

.trigger {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  height: var(--control-height);
  padding: 0 var(--space-3);
  /* A trigger is a field, not a button (arch 09 §4): fill one step off the
     surface, bottom border only. The baseline recipe in base.css reaches only
     input/textarea elements, so this <button> restates it. */
  border: none;
  border-block-end: var(--border-width) solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--field);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background var(--dur-fast) var(--ease),
    color var(--dur-fast) var(--ease);
}

.trigger:hover:not(:disabled),
.trigger[aria-expanded='true'] {
  background: var(--field-hover);
}

.trigger:disabled {
  cursor: default;
  opacity: 0.6;
}

.trigger:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -2px;
}

.triggerLabel {
  min-width: 0;
  /* Cap the trigger so a long value (a preset or user theme name) can't blow
     out a crowded pane header at narrow widths; the full label stays available
     in the open list and the trigger's aria-label (arch 10 §5). */
  max-width: 16ch;
  overflow: hidden;
  text-overflow: ellipsis;
}

.caret {
  font-size: 10px;
  color: var(--text-secondary);
}

/* The disclosed panel — portaled to <body>, fixed, above modal content. */
.pop {
  position: fixed;
  z-index: 2000;
  min-width: 150px;
  max-width: 320px;
  padding: var(--space-2);
  background: var(--layer-01);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.4);
}

.heading {
  margin: 0 0 var(--space-2);
  padding: 0 var(--space-2);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

/* A long option list (a 25-column filter-field picker) scrolls in place. */
.list {
  display: flex;
  flex-direction: column;
  max-height: min(320px, 50vh);
  overflow-y: auto;
}

/* Group separator (an option's `dividerBefore`) — spans the panel edge to edge. */
.divider {
  height: var(--border-width);
  margin: var(--space-2) calc(-1 * var(--space-2));
  background: var(--border);
}

.option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease);
}

.option:hover {
  background: var(--layer-02);
}

.option:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -1px;
}

.selected {
  font-weight: 600;
}

.optionLabel {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
}

/* Decorative leading visual (e.g. a color-scheme swatch strip / gradient bar). */
.optionPreview {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
}

.detail {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-secondary);
}
