/* Shared selection-field geometry. KPI's 15px chevron, inset 14px, is the reference. */
:root {
  --select-chevron-inset: 14px;
  --select-chevron-text-space: 38px;
}

/* These properties alone must win over lazy screen-specific select styles. */
html body select:not([multiple]):is(:not([size]), [size="1"]) {
  appearance: none !important;
  -webkit-appearance: none !important;
  padding-inline-end: var(--select-chevron-text-space) !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='m6 9 6 6 6-6' stroke='%235c7090' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
  background-position: right var(--select-chevron-inset) center !important;
  background-size: 15px 15px !important;
  background-repeat: no-repeat !important;
  text-overflow: ellipsis;
}

html[data-theme="dark"] body select:not([multiple]):is(:not([size]), [size="1"]) {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='m6 9 6 6 6-6' stroke='%23c2d2e6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
}

/* This wrapper already contained an SVG; the shared native-field arrow replaces it. */
.sales-list-select > svg {
  display: none !important;
}

/* DOM dropdowns keep their existing menu behaviour and use the same edge inset. */
.ta-select-trigger,
.lead-filter-trigger {
  padding-inline-end: var(--select-chevron-inset) !important;
}
.lead-filter-trigger {
  gap: 10px;
}
.lead-filter-trigger > svg,
.ta-select-trigger > svg {
  flex-shrink: 0;
}
.sales-list-filters .lead-filter-trigger {
  padding-inline-end: var(--select-chevron-text-space) !important;
}
.sales-list-filters .lead-filter-trigger > svg {
  right: var(--select-chevron-inset) !important;
}

/* Free-entry product fields retain the browser's picker and its keyboard behaviour. */
input[list] {
  padding-inline-end: var(--select-chevron-inset) !important;
}
input[list]::-webkit-calendar-picker-indicator {
  margin-inline-end: 0;
  padding-inline-end: 0;
}

/* Narrow board cards need room for both the selected value and the shared inset. */
.sfa-deal-workspace .sfa-card-quick-actions {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 114px), 1fr));
}
.sfa-priority-table select {
  min-width: 114px;
}

@media (max-width: 520px) {
  .sfa-form .sfa-fields-2 {
    grid-template-columns: 1fr;
  }
}
