/* ── Carbon Combo Box ─────────────────────────────────────────── */

.cbox-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cbox-label {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-secondary);
  letter-spacing: 0.32px;
}

.cbox-field {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--field-bg, #f4f4f4);
  border: none;
  border-bottom: 1px solid var(--border-strong, #8d8d8d);
  height: 2.5rem;
}

html.dark .cbox-field {
  background: var(--field-bg, #262626);
}

.cbox-field:focus-within {
  outline: 2px solid var(--blue-60, #0f62fe);
  outline-offset: -2px;
}

.cbox-input {
  flex: 1;
  height: 100%;
  padding: 0 0.75rem;
  background: transparent;
  border: none;
  outline: none;
  font-size: 0.875rem;
  color: var(--text);
  font-family: 'IBM Plex Sans', sans-serif;
  min-width: 0;
}

.cbox-input::placeholder {
  color: var(--text-secondary);
}

.cbox-input:disabled {
  cursor: not-allowed;
  color: var(--text-secondary);
  opacity: 0.5;
}

.cbox-input:disabled ~ .cbox-clear,
.cbox-input:disabled ~ .cbox-divider,
.cbox-input:disabled ~ .cbox-chevron {
  cursor: not-allowed;
  opacity: 0.5;
}

/* ── Clear button ─────────────────────────────────────────────── */
.cbox-clear {
  flex-shrink: 0;
  width: 2rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 0;
}
.cbox-clear:hover { color: var(--text); }

/* ── Divider between clear and chevron ────────────────────────── */
.cbox-divider {
  width: 1px;
  height: 1rem;
  background: var(--border-strong, #8d8d8d);
  flex-shrink: 0;
}

/* ── Chevron ──────────────────────────────────────────────────── */
.cbox-chevron {
  flex-shrink: 0;
  width: 2.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
  transition: background 0.1s;
}

.cbox-chevron svg {
  transition: transform 0.15s ease;
}

.cbox-chevron:hover {
  background: var(--hover-bg, rgba(0,0,0,0.06));
}

html.dark .cbox-chevron:hover {
  background: rgba(255,255,255,0.08);
}

.cbox-wrap.is-open .cbox-chevron svg {
  transform: rotate(180deg);
}

/* ── Dropdown list ────────────────────────────────────────────── */

.cbox-list {
  position: absolute;
  top: calc(100%);
  left: 0;
  right: 0;
  z-index: 300;
  background: var(--panel-bg);
  border: 1px solid var(--border);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 14.5rem;
  overflow-y: auto;
}

.cbox-list li {
  display: flex;
  align-items: center;
  padding: 0.6875rem 1rem;
  font-size: 0.875rem;
  color: var(--text);
  cursor: pointer;
  transition: background 0.1s;
  border-bottom: 1px solid var(--border);
  font-family: 'IBM Plex Sans', sans-serif;
  user-select: none;
}

.cbox-list li:last-child {
  border-bottom: none;
}

.cbox-list li:hover {
  background: var(--hover-bg, rgba(0,0,0,0.06));
  color: var(--text);
}
html.dark .cbox-list li:hover {
  background: rgba(255,255,255,0.08);
}

/* Keyboard-focused item  -  blue outline, no background fill */
.cbox-list li.cbox-focused {
  outline: 2px solid var(--blue-60, #0f62fe);
  outline-offset: -2px;
}

.cbox-list li.cbox-selected {
  background: var(--blue-60, #0f62fe);
  color: var(--text-on-color);
}

html.dark .cbox-list li.cbox-selected {
  background: var(--blue-60, #0f62fe);
  color: var(--text-on-color);
}

.cbox-list li.cbox-selected:hover,
.cbox-list li.cbox-selected.cbox-focused {
  background: var(--blue-70, #0353e9);
}

.cbox-list li[aria-disabled="true"] {
  color: var(--text-secondary);
  cursor: not-allowed;
  pointer-events: none;
}

/* ── No results ───────────────────────────────────────────────── */
.cbox-empty {
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  cursor: default;
}

/* ── Inline variant (no absolute positioning needed) ──────────── */
.cbox-wrap.cbox-inline .cbox-list {
  position: static;
  box-shadow: none;
}
