/* Shared custom select: replaces the native macOS/Windows picker everywhere. */

.yam-select {
  position: relative;
  display: inline-flex;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  vertical-align: middle;
}

.yam-select-native {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  appearance: none;
  -webkit-appearance: none;
  pointer-events: none;
}

.yam-select-trigger {
  display: inline-flex;
  width: 100%;
  min-width: 0;
  min-height: 36px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--line, var(--border, var(--panel-border, #303a4a)));
  border-radius: 8px;
  color: inherit;
  background: var(--surface-raised, var(--surface, var(--panel, #1d2431)));
  font: inherit;
  text-align: left;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.yam-select-trigger:hover {
  border-color: var(--line-strong, var(--cobalt, var(--accent, #8299ef)));
}

.yam-select-trigger:focus-visible,
.yam-select-trigger[aria-expanded="true"] {
  border-color: var(--cobalt, var(--accent, var(--focus, #8299ef)));
  outline: none;
}

.yam-select-trigger:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.yam-select-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.yam-select-trigger.is-placeholder .yam-select-value {
  color: var(--faint, var(--muted, #7f8a9b));
}

.yam-select-trigger svg {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  color: var(--faint, var(--muted, #7f8a9b));
  transition: transform 140ms ease;
}

.yam-select-trigger svg path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.yam-select-trigger[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.yam-select-panel {
  position: fixed;
  z-index: 400;
  inset: unset;
  margin: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 4px;
  border: 1px solid var(--line-strong, var(--border, #465267));
  border-radius: 8px;
  color: var(--text, var(--ink, #f1f4f9));
  background: var(--surface-raised, var(--surface, var(--panel, #1d2431)));
  box-shadow: var(--shadow-soft, 0 12px 40px rgba(0, 0, 0, 0.28));
  color-scheme: dark;
}

.yam-select-panel[hidden] {
  display: none !important;
}

.yam-select-panel[popover]:not(:popover-open) {
  display: none;
}

.yam-select-option {
  display: flex;
  width: 100%;
  min-height: 32px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  color: inherit;
  background: transparent;
  font: inherit;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.yam-select-option-content {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.yam-select-option-label {
  min-width: 0;
  overflow-wrap: anywhere;
}

.yam-select-option-recommended {
  flex: 0 0 auto;
  padding: 1px 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--positive, #65c7cf) 16%, transparent);
  color: var(--positive, #65c7cf);
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.yam-select-option-info {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 1px solid var(--line-strong, #46526e);
  color: var(--faint, var(--muted, #7f8a9b));
  font-size: 0.62rem;
  font-style: normal;
  font-family: var(--font-sans, sans-serif);
  line-height: 1;
  cursor: help;
}

.yam-select-option:hover .yam-select-option-info,
.yam-select-option:focus-visible .yam-select-option-info {
  border-color: var(--cobalt, var(--accent, #8299ef));
  color: var(--cobalt, var(--accent, #8299ef));
}

.yam-select-option:hover,
.yam-select-option:focus-visible {
  background: var(--surface-hover, var(--surface-subtle, #202836));
  outline: none;
}

.yam-select-option[aria-selected="true"] {
  color: var(--cobalt, var(--accent, #8299ef));
  background: color-mix(in srgb, var(--cobalt, #8299ef) 10%, transparent);
}

.yam-select-option[aria-selected="true"]::after {
  content: "";
  width: 6px;
  height: 11px;
  flex: 0 0 auto;
  margin-right: 2px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
}

.yam-select-option[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.45;
}
