/* ClaritySelect: the product's own dropdown (see select.js). Portal tokens only, so it follows
   whatever portal.css (or form.css, for the public form) defines, dark themes included.
   The workspace's compact grammar: a 32px trigger on a desktop (44px under a finger), a chevron
   that turns over when open, an azure border and 3px ring while open, a portalled panel with a
   160ms pop, 28px rows (44px under a finger), a quiet fill on hover and a check on the chosen row. */

/* The native select stays in the form as the value; it is hidden but still submitted. The
   !important beats page rules such as ".ge-toolbar select{display:block;width:100%}". */
select.cs-native {
  position: absolute !important;
  width: 1px !important;
  min-width: 0 !important;
  max-width: 1px !important;
  height: 1px !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: -1px !important;
  border: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.cs { position: relative; display: block; width: 100%; min-width: 0; max-width: 100%; }
.cs-sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.cs-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  height: 32px;
  min-height: 32px;
  margin: 0;
  padding: 0 8px 0 10px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: normal;
  text-align: left;
  text-transform: none;
  box-shadow: none;
  cursor: pointer;
  transition: border-color 120ms ease, box-shadow 120ms ease;
  -webkit-tap-highlight-color: transparent;
}
.cs-trigger:hover { border-color: var(--line-strong); background: var(--surface); color: var(--ink); }
.cs-trigger:focus { outline: none; }
.cs-trigger:focus-visible { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--focus-ring); }
.cs.is-open .cs-trigger {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
.cs-trigger:disabled { background: var(--surface-2); color: var(--ink-3); border-color: var(--line-2); cursor: not-allowed; opacity: 1; }
.cs-trigger[aria-invalid="true"] { border-color: var(--danger, var(--rust)); }

.cs-value { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs.is-placeholder .cs-value { color: var(--ink-3); }
.cs-chevron {
  flex: none;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--ink-3);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 150ms cubic-bezier(.2, 0, 0, 1);
}
.cs.is-open .cs-chevron { transform: rotate(180deg); }

/* The panel is appended to <body> (or the open dialog), fixed to the viewport by select.js. */
.cs-panel {
  position: fixed;
  z-index: 1000;
  top: 0;
  left: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  max-height: 320px;
  padding: 4px;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-pop);
  font-size: 13px;
  line-height: 1.35;
  text-align: left;
  transform-origin: top center;
}
.cs-panel[hidden] { display: none; }
.cs-panel.is-up { transform-origin: bottom center; }
.cs-list {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  outline: none;
}

.cs-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  box-sizing: border-box;
  min-height: 28px;
  padding: 4px 8px;
  border-radius: var(--radius-control);
  color: var(--ink);
  cursor: pointer;
  user-select: none;
}
.cs-option-text { min-width: 0; overflow-wrap: anywhere; }
.cs-option:hover,
.cs-option.is-active { background: var(--surface-3); }
.cs-option.is-selected { color: var(--ink); font-weight: 500; }
.cs-option.is-selected .cs-option-text { color: var(--ink); }
.cs-check {
  flex: none;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--brand-ink);
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  visibility: hidden;
}
.cs-option.is-selected .cs-check { visibility: visible; }
.cs-option.is-disabled,
.cs-option.is-disabled:hover { background: transparent; color: var(--ink-3); opacity: .6; cursor: not-allowed; }

@media (prefers-reduced-motion: no-preference) {
  .cs-panel.is-open { animation: cs-pop 160ms cubic-bezier(.2, .8, .2, 1); }
}
@media (prefers-reduced-motion: reduce) {
  .cs-trigger, .cs-chevron { transition: none; }
}
@keyframes cs-pop {
  from { opacity: 0; transform: scale(.96); }
  to { opacity: 1; transform: scale(1); }
}

/* Phones and touch screens get 44px targets, with 16px text so iOS never zooms into the page. */
@media (max-width: 767px), (pointer: coarse) {
  .cs-trigger { height: 44px; min-height: 44px; padding: 0 10px 0 12px; font-size: 16px; }
  .cs-panel { font-size: 15px; padding: 6px; }
  .cs-option { min-height: 44px; padding: 10px 10px 10px 12px; }
}

/* Placements: where a page's own rule styled the native select, the drawn one takes its place. */
.ge-toolbar .cs { margin-top: 5px; }
.actions > .cs.experience-filter { width: auto; flex: 0 1 220px; min-width: 180px; }
