#crm-dropdown-portal {
  position: fixed;
  inset: 0;
  z-index: 1550;
  pointer-events: none;
}

.crm-select { position: relative; min-width: 0; width: 100%; }
.crm-select-native {
  position: absolute !important;
  width: 1px !important;
  min-width: 1px !important;
  height: 1px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.crm-select-trigger {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 34px;
  padding: 6px 9px;
  border: 1px solid var(--color-border-primary);
  border-radius: var(--border-radius-md);
  background: var(--color-background-primary);
  color: var(--color-text-primary);
  font: inherit;
  letter-spacing: 0;
  text-align: left;
  cursor: pointer;
}
.crm-select-trigger:hover { border-color: var(--color-text-warning); }
.crm-select-trigger:focus-visible,
.crm-select.is-open .crm-select-trigger {
  border-color: var(--color-text-warning);
  outline: 2px solid color-mix(in srgb, var(--color-text-warning) 28%, transparent);
  outline-offset: 1px;
}
.crm-select.is-invalid .crm-select-trigger,
.crm-select.has-error .crm-select-trigger { border-color: var(--color-text-danger, #c92a2a); }
.crm-select-trigger:disabled { cursor: not-allowed; opacity: .52; }
.crm-select-trigger__label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-select-trigger .ti { transition: transform .15s ease; }
.crm-select.is-open .crm-select-trigger .ti { transform: rotate(180deg); }
.crm-select.is-loading .crm-select-trigger { cursor: wait; }

.crm-select-menu {
  position: fixed;
  z-index: 1;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 4px;
  border: 1px solid var(--color-border-primary);
  border-radius: var(--border-radius-md);
  background: var(--color-background-primary);
  color: var(--color-text-primary);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .22);
  overscroll-behavior: contain;
  pointer-events: auto;
}
.crm-select-group { display: contents; }
.crm-select-group__label {
  padding: 8px 9px 4px;
  color: var(--color-text-secondary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}
.crm-select-option {
  display: flex !important;
  flex: 0 0 auto;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  height: auto !important;
  block-size: auto !important;
  min-height: 32px;
  min-block-size: 32px;
  box-sizing: border-box;
  padding: 7px 9px;
  border: 0;
  border-radius: calc(var(--border-radius-md) - 2px);
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: 0;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.crm-select-search {
  box-sizing: border-box;
  display: block;
  width: calc(100% - 16px);
  margin: 8px;
  padding: 8px 10px;
  border: 1px solid var(--crm-border, var(--line, #d6d9df));
  border-radius: 8px;
  background: var(--crm-surface, var(--surface, #fff));
  color: var(--crm-text, var(--text, #172033));
  font: inherit;
}

.crm-select-option__marker {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--crm-select-marker-color, currentColor);
  box-shadow: 0 0 0 1px color-mix(in srgb, currentColor 25%, transparent);
}

.crm-select-option__label {
  min-width: 0;
  overflow-wrap: anywhere;
}
.crm-select-option:hover,
.crm-select-option.is-active { background: var(--color-background-warning); color: var(--color-text-warning); }
.crm-select-option[aria-selected="true"] { box-shadow: inset 3px 0 0 var(--color-text-warning); font-weight: 600; }
.crm-select-option:disabled { cursor: not-allowed; opacity: .42; }
.crm-select-option:disabled:hover { background: transparent; color: inherit; }

:root[data-ui-mode="atmosphere"] .crm-select-trigger {
  background: rgba(34, 31, 23, .92);
  border-color: rgba(255, 193, 92, .32);
  color: #fff7e6;
}
:root[data-ui-mode="atmosphere"] .crm-select-menu {
  background: rgba(25, 24, 19, .98);
  border-color: rgba(255, 193, 92, .52);
  color: #fff7e6;
  box-shadow: 0 16px 34px rgba(0, 0, 0, .46);
}
:root[data-ui-mode="atmosphere"] .crm-select-group__label { color: rgba(255, 247, 230, .68); }
:root[data-ui-mode="atmosphere"] .crm-select-option:hover,
:root[data-ui-mode="atmosphere"] .crm-select-option.is-active { background: rgba(230, 119, 0, .24); color: #fff1cc; }
:root[data-ui-mode="atmosphere"] .crm-select-option[aria-selected="true"] {
  background: rgba(230, 119, 0, .16);
  box-shadow: inset 3px 0 0 var(--color-text-warning);
}
:root[data-ui-mode="atmosphere"] .crm-select-option:disabled { color: rgba(255, 247, 230, .46); }
