/* Pickers: every <select> becomes a box with a list (combobox_controller.js). */

/* The real <select> stays in the form, invisible, where the box starts, so the
   browser's "please choose one" message points at the right place. */
.combobox-native {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.combobox {
  position: relative;
  display: block;
  min-width: 0;
}

.combobox-input.input,
.combobox-input {
  width: 100%;
  padding-right: 34px;
  text-overflow: ellipsis;
}

.combobox-input[readonly] {
  cursor: pointer;
  caret-color: transparent;
}

.combobox.is-blank .combobox-input[readonly] {
  color: var(--ink-3);
}

.combobox-input:disabled {
  background: var(--steel);
  color: var(--ink-3);
  cursor: not-allowed;
}

.combobox-chevron {
  position: absolute;
  top: 50%;
  right: 10px;
  display: flex;
  translate: 0 -50%;
  color: var(--ink-3);
  cursor: pointer;
}

.combobox-input:disabled + .combobox-chevron {
  pointer-events: none;
  opacity: 0.5;
}

/* The list is a popover, so it shows above popups and is never cut off. */
.combobox-list {
  position: fixed;
  inset: auto;
  margin: 0;
  padding: 4px;
  max-width: min(520px, calc(100vw - 16px));
  overflow-y: auto;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 16px 40px -12px rgb(19 28 51 / 0.35);
  list-style: none;
  font: 400 15px/1.3 var(--font-body-stack);
}

.combobox-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
}

.combobox-option.is-active {
  background: var(--carbon-wash);
}

.combobox-option[aria-selected='true'] {
  font-weight: 600;
}

.combobox-option[aria-selected='true']::after {
  content: "✓";
  margin-left: auto;
  color: var(--carbon);
}

.combobox-option.is-blank {
  color: var(--ink-3);
}

.combobox-option[aria-disabled='true'] {
  color: var(--ink-3);
  cursor: default;
}

.combobox-group {
  padding: 10px 10px 4px;
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.combobox-note {
  padding: 10px;
  color: var(--ink-3);
  font-size: 14px;
}

.combobox-add {
  margin-top: 4px;
  border-top: 1px solid var(--line);
  border-radius: 0 0 6px 6px;
  color: var(--carbon);
  font-weight: 600;
}

/* Phones: bigger rows for thumbs. */
@media (pointer: coarse) {
  .combobox-option {
    min-height: 48px;
  }
}
