/* Native form controls remain in place; buttons and popovers provide the visible UI. */
.cs-root {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.cs-root > select.cs-native {
  position: absolute;
  inset: 0 auto auto 0;
  width: 1px;
  min-width: 0;
  max-width: 1px;
  height: 1px;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  clip-path: inset(50%);
  pointer-events: none;
}

.cs-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-width: 0;
  min-height: 42px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #cad8d2;
  border-radius: 9px;
  background: #fff;
  color: #294337;
  font: inherit;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.45;
  text-align: left;
  cursor: pointer;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.cs-trigger:hover:not(:disabled) {
  border-color: #9fb8ae;
  background: #fbfdfc;
}

.cs-trigger:focus-visible,
.cs-trigger[aria-expanded="true"] {
  border-color: #008967;
  outline: 0;
  box-shadow: 0 0 0 3px #00896720;
}

.cs-trigger:disabled {
  border-color: #dce5e0;
  background: #f3f6f4;
  color: #6b7c73;
  opacity: 1;
  cursor: not-allowed;
}

.cs-value {
  display: block;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}

.cs-arrow,
.cs-option-check {
  display: inline-flex;
  flex: 0 0 17px;
  align-items: center;
  justify-content: center;
  color: #738b7c;
}

.cs-arrow svg,
.cs-option-check svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cs-trigger[aria-expanded="true"] .cs-arrow {
  color: #008967;
  transform: rotate(180deg);
}

.cs-popup {
  position: fixed;
  inset: auto;
  z-index: 100000;
  display: flex;
  flex-direction: column;
  width: 280px;
  min-width: 0;
  max-width: calc(100vw - 16px);
  max-height: min(360px, calc(100dvh - 16px));
  margin: 0;
  padding: 5px;
  overflow: hidden;
  border: 1px solid #cadbd1;
  border-radius: 11px;
  background: #fff;
  color: #294337;
  box-shadow: 0 12px 36px #203d2e26, 0 2px 8px #203d2e0d;
  font-family: Manrope, 'Segoe UI', Arial, sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.45;
  text-align: left;
  isolation: isolate;
}

.cs-popup[popover]:not(:popover-open) {
  display: none;
}

.cs-popup::backdrop {
  background: transparent;
  pointer-events: none;
}

.cs-search-wrap {
  flex: 0 0 auto;
  padding: 3px 3px 8px;
  border-bottom: 1px solid #e5ece7;
  margin-bottom: 4px;
}

.cs-popup .cs-search {
  width: 100%;
  min-width: 0;
  min-height: 39px;
  padding: 8px 10px;
  border: 1px solid #cfddd5;
  border-radius: 7px;
  background: #f7faf8;
  color: #294337;
  font-size: 13px;
}

.cs-options {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #b9ccc1 transparent;
}

.cs-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  min-height: 38px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  cursor: pointer;
}

.cs-option-text {
  flex: 1 1 auto;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}

.cs-option-check {
  margin-top: 1px;
  color: #008967;
  visibility: hidden;
}

.cs-option[aria-selected="true"] {
  color: #007456;
  background: #e9f5ee;
  font-weight: 600;
}

.cs-option[aria-selected="true"] .cs-option-check {
  visibility: visible;
}

.cs-option.is-active {
  border-color: #b5d8c7;
  background: #f0f7f3;
}

.cs-option.is-active[aria-selected="true"] {
  background: #e1f1e8;
}

.cs-option[aria-disabled="true"] {
  color: #87958d;
  background: transparent;
  cursor: not-allowed;
}

.cs-group {
  padding: 10px 10px 5px;
  color: #61786a;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
}

.cs-empty {
  padding: 18px 12px;
  color: #6b7f72;
  font-size: 13px;
}

.cs-error {
  display: block;
  margin-top: 6px;
  color: #ad3542;
  font-size: 12px;
  line-height: 1.45;
}

.cs-trigger[aria-invalid="true"] {
  border-color: #c5525e;
}

.cs-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.toolbar .cs-root {
  flex: 0 1 auto;
  width: auto;
  max-width: 220px;
}

.registry-toolbar .cs-root {
  flex: 0 1 156px;
  width: auto;
  min-width: 130px;
  max-width: 190px;
}

@media (max-width: 800px) {
  .cs-trigger {
    min-height: 46px;
    font-size: 16px;
  }

  .cs-option {
    min-height: 44px;
    padding: 11px 10px;
  }

  .cs-popup {
    font-size: 15px;
  }

  .cs-popup .cs-search {
    min-height: 44px;
    font-size: 16px;
  }

  .toolbar .cs-root,
  .registry-toolbar .cs-root {
    flex: 1 1 130px;
    width: 100%;
    min-width: 0;
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cs-trigger { transition: none; }
}
