/* Scoped custom select enhancement for the Studio creative composer. */
#em-creative-form .em-bitrate-toggle { display: flex; align-items: center; gap: 8px; min-height: 42px; color: #e7daef; font-size: 11px; cursor: pointer; }
#em-creative-form .em-bitrate-toggle[hidden] { display: none !important; }
#em-creative-form .em-bitrate-toggle input { width: 27px; height: 16px; flex-shrink: 0; accent-color: #dc8ee8; cursor: pointer; }
#em-creative-form .em-bitrate-toggle small { display: block; margin-top: 2px; color: #a59bac; font-size: 9px; }
#em-creative-form .em-reference-panel:has(.em-video-reference:not([hidden])) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(105px, .7fr);
  gap: 12px;
  align-items: start;
}
#em-creative-form .em-video-reference { min-width: 0; display: grid; gap: 9px; }
#em-creative-form .em-video-reference[hidden],
#em-creative-form .em-video-reference [hidden] { display: none !important; }
#em-creative-form .em-add-video-reference {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 100%; min-height: 90px; gap: 7px; padding: 10px;
  border: 1px dashed #655275; border-radius: 12px;
  background: #1c1725; color: #dcd3e5; font: inherit; font-size: 12px; cursor: pointer;
}
#em-creative-form .em-add-video-reference > span { font-size: 22px; }
#em-creative-form .em-video-reference-preview { position: relative; min-width: 0; }
#em-creative-form .em-video-reference-preview video {
  display: block; width: 100%; height: 100px; object-fit: contain;
  border-radius: 10px; background: #0e0b13;
}
#em-creative-form #em-remove-video-reference {
  position: absolute; right: -5px; top: -7px; width: 28px; height: 28px;
  padding: 0; border: 1px solid #776589; border-radius: 50%;
  background: #292032; color: #fff; font-size: 20px; cursor: pointer;
}
#em-creative-form #em-video-reference-status { color: #aaa0b6; font-size: 10px; line-height: 1.45; overflow-wrap: anywhere; }
#em-creative-form #em-video-reference-billing { color: #aaa0b6; font-size: 10px; line-height: 1.45; }
@media (max-width: 480px) {
  #em-creative-form .em-reference-panel:has(.em-video-reference:not([hidden])) {
    grid-template-columns: minmax(0, 1fr) 112px; gap: 10px;
  }
  #em-creative-form .em-reference-panel:has(.em-video-reference:not([hidden])) .em-reference-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

#em-creative-form .em-select {
  position: relative;
  display: inline-block;
  width: 100%;
  min-width: 0;
  vertical-align: middle;
}

#em-creative-form .em-select-native-inactive {
  display: none !important;
}

#em-creative-form .em-select-native-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  pointer-events: none !important;
}

#em-creative-form .em-select-trigger {
  display: flex;
  width: 100%;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 34px 0 12px;
  border: 1px solid rgba(224, 214, 241, .16);
  border-radius: 10px;
  background: #1d1926;
  color: #f0ebf7;
  font: inherit;
  font-size: 12px;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
  transition: border-color .16s ease, background-color .16s ease;
}

#em-creative-form .em-select-trigger::after {
  position: absolute;
  right: 13px;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid #bfb2d1;
  border-bottom: 1.5px solid #bfb2d1;
  content: "";
  transform: translateY(-2px) rotate(45deg);
  transition: transform .16s ease;
}

#em-creative-form .em-select-trigger:hover:not(:disabled) {
  border-color: rgba(219, 190, 244, .38);
  background: #231e2d;
}

#em-creative-form .em-select-trigger:focus-visible {
  outline: 2px solid #caa2e6;
  outline-offset: 2px;
}

#em-creative-form .em-select-trigger:disabled {
  color: #81798c;
  cursor: not-allowed;
  opacity: .62;
}

#em-creative-form .em-select.is-open .em-select-trigger {
  border-color: rgba(220, 183, 243, .58);
  border-bottom-left-radius: 7px;
  border-bottom-right-radius: 7px;
}

#em-creative-form .em-select.is-open .em-select-trigger::after {
  transform: translateY(2px) rotate(225deg);
}

#em-creative-form .em-select-listbox {
  position: absolute;
  z-index: 40;
  inset: calc(100% + 5px) 0 auto;
  max-height: min(260px, 42dvh);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 5px;
  border: 1px solid rgba(207, 186, 226, .2);
  border-radius: 11px;
  background: #201b29;
  box-shadow: 0 12px 32px rgba(4, 2, 8, .48);
  -webkit-overflow-scrolling: touch;
  scrollbar-color: #665873 transparent;
  scrollbar-width: thin;
}

#em-creative-form .em-select-listbox[hidden] { display: none; }
#em-creative-form .em-select.is-up .em-select-listbox { inset: auto 0 calc(100% + 5px); }

#em-creative-form .em-select-option {
  display: flex;
  min-height: 38px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 7px;
  color: #d5cddd;
  font-size: 12px;
  line-height: 1.3;
  cursor: pointer;
  touch-action: pan-y;
}

#em-creative-form .em-select-option:hover,
#em-creative-form .em-select-option.is-active {
  background: rgba(196, 164, 221, .13);
  color: #fff;
}

#em-creative-form .em-select-option.is-selected {
  color: #f1c6eb;
}

#em-creative-form .em-select-option.is-selected::after {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  margin-left: auto;
  border-radius: 50%;
  background: #e99cda;
  content: "";
}

#em-creative-form .em-select-empty {
  padding: 10px;
  color: #a79cad;
  font-size: 11px;
}

@media (max-width: 767px) {
  #em-creative-form .em-select-listbox {
    max-height: min(240px, 36dvh);
    border-radius: 10px;
  }
  #em-creative-form .em-select-option { min-height: 42px; }
}

@media (prefers-reduced-motion: reduce) {
  #em-creative-form .em-select-trigger,
  #em-creative-form .em-select-trigger::after { transition: none; }
}
