/* Scoped custom selects. Layout tokens belong to callers; clipping belongs to the surface. */
.gw-select,
.gw-combobox {
  --gw-control-height: 38px;
  display: inline-flex;
  position: relative;
  min-width: 0;
  width: 100%;
  vertical-align: middle;
  color: var(--ink);
  font: inherit;
}
.gw-select-compact {
  --gw-control-height: 28px;
}
:where(.gw-select).filter-select {
  padding: 0;
  width: var(--filter-select-width, 140px);
  min-width: var(--filter-select-width, 140px);
  max-width: var(--filter-select-width, 140px);
}
.gw-select-trigger,
.gw-combobox-input {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  height: var(--gw-control-height);
  padding: 4px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface, #fff);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.gw-select-trigger:hover,
.gw-combobox-input:hover {
  border-color: var(--muted);
}
.gw-select-trigger:focus-visible,
.gw-combobox-input:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
.gw-select-trigger[aria-invalid="true"] {
  border-color: #b42318;
}
.gw-select-invalid {
  flex-wrap: wrap;
}
.gw-select-error {
  flex: 0 0 100%;
  color: #b42318;
  font-size: 12px;
  padding-top: 4px;
}
.gw-select-error[hidden] {
  display: none;
}
.gw-select-trigger:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.gw-select-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gw-select-label > span {
  display: inline;
}
.gw-select-trigger > .icon {
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
  transform: rotate(90deg);
}
.gw-select-trigger[aria-expanded="true"] > .icon {
  transform: rotate(-90deg);
}
.gw-select.is-default .gw-select-label {
  color: var(--muted);
}
.gw-selection-popup[popover] {
  position: fixed;
  inset: auto;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: visible;
  color: var(--ink);
  background: transparent;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.16);
  font: inherit;
}
.gw-selection-popup[hidden],
.gw-selection-header[hidden],
.gw-selection-feedback[hidden],
.gw-select-chips[hidden] {
  display: none;
}
.gw-selection-surface {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  max-height: 300px;
  min-height: 0;
  overflow: hidden;
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface, #fff);
}
.gw-selection-scroll {
  min-height: 0;
  flex: 1 1 auto;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #c5cad3 transparent;
  scrollbar-gutter: auto;
}
.gw-selection-scroll::-webkit-scrollbar {
  width: 8px;
}
.gw-selection-scroll::-webkit-scrollbar-track,
.gw-selection-scroll::-webkit-scrollbar-corner {
  background: transparent;
}
.gw-selection-scroll::-webkit-scrollbar-thumb {
  background: #c5cad3;
  border-radius: 999px;
}
.gw-selection-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  box-sizing: border-box;
  padding: 5px 8px;
  border-radius: 4px;
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
}
.gw-selection-option > span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gw-selection-option.is-active,
.gw-selection-option[aria-selected="true"] {
  background: var(--brand-soft);
  color: var(--brand);
}
.gw-selection-option[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
}
.gw-selection-check {
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
  visibility: hidden;
}
.gw-selection-option[aria-selected="true"] > .gw-selection-check {
  visibility: visible;
}
.gw-selection-header {
  flex: 0 0 auto;
  padding: 2px 2px 6px;
}
.gw-selection-search {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  height: 32px;
  padding: 4px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--surface, #fff);
  color: var(--ink);
  font: inherit;
}
.gw-selection-search:focus {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}
.gw-selection-feedback {
  flex: 0 0 auto;
  padding: 6px 4px 2px;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.gw-selection-feedback [role="alert"] {
  max-height: 48px;
  overflow: hidden;
}
.gw-selection-feedback button {
  border: 0;
  background: transparent;
  color: var(--brand);
  padding: 4px;
  cursor: pointer;
  font: inherit;
}
.gw-select-chips {
  display: contents;
}
.gw-select:has(> .gw-select-chips:not([hidden])) {
  box-sizing: border-box;
  flex-flow: row wrap;
  align-items: center;
  gap: 4px;
  min-height: 38px;
  padding: 3px 4px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface, #fff);
}
.gw-select:has(> .gw-select-chips:not([hidden])) > .gw-select-trigger {
  flex: 1 1 140px;
  width: auto;
  min-width: min(140px, 100%);
  height: 28px;
  padding: 3px 4px;
  border: 0;
}
.gw-select-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 2px 5px;
  border-radius: 4px;
  background: var(--brand-soft);
  font-size: 12px;
}
.gw-select-chip > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gw-select-chip button {
  display: flex;
  flex: none;
  border: 0;
  padding: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}
.gw-select-chip button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.gw-select-chip .icon {
  width: 12px;
  height: 12px;
}
.gw-combobox-input {
  cursor: text;
  padding-right: 30px;
}
.gw-combobox-toggle {
  position: absolute;
  right: 0;
  top: 0;
  width: 28px;
  height: var(--gw-control-height);
  display: grid;
  place-items: center;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
}
.gw-combobox-toggle .icon {
  width: 14px;
  height: 14px;
  transform: rotate(90deg);
}
.gw-combobox-toggle[aria-expanded="true"] .icon {
  transform: rotate(-90deg);
}
