/* Shared selects: isolated from task controls and legacy modal overrides. */
.musideo-select { position: relative; width: 100%; font: inherit; }
.musideo-select > .custom-select-trigger { position: relative; cursor: pointer; }
.musideo-select > .custom-select-trigger::after { position: absolute; }
.musideo-select > .custom-select-trigger[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.musideo-select > .custom-select-trigger[aria-invalid="true"] { border-color: #d04747 !important; }
.musideo-select-popup { display: none; z-index: 2147482001; }
.musideo-select.open > .musideo-select-popup { display: block; }
.musideo-select-popup .custom-select-search-box { position: sticky; z-index: 1; }
.musideo-select-popup .custom-select-search { width: 100%; box-sizing: border-box; border: 1px solid var(--ui2-border, #dfe3ee); border-radius: 8px; padding: 8px 10px; font: inherit; color: inherit; }
.musideo-select-popup .custom-select-option { border: 0; border-radius: 8px; text-align: left; font: inherit; background: transparent; cursor: pointer; }
.musideo-select-popup .custom-select-option:disabled { opacity: .5; cursor: not-allowed; }
.musideo-select-popup [hidden] { display: none !important; }
.musideo-select-popup .custom-select-empty { padding: 12px; font-size: 14px; }
.musideo-select .has-color::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--option-color); margin-right: 8px; flex-shrink: 0; }
:is(.musideo-select, #importSectionsModal .musideo-select) {
  background: none !important;
  border: 0 !important;
  padding: 0 !important;
  box-shadow: none !important;
}
:is(.musideo-select, #importSectionsModal .musideo-select) > .custom-select-trigger {
  box-sizing: border-box !important;
  display: flex !important;
  align-items: center;
  width: 100%;
  min-height: 42px !important;
  padding: 10px 38px 10px 14px !important;
  border: 1px solid var(--ui2-border, #dfe3ee) !important;
  border-radius: 10px !important;
  background: var(--ui2-surface, #fff) !important;
  color: var(--ui2-ink, #24263a) !important;
  font-size: 14px !important;
  line-height: 1.45 !important;
  box-shadow: none !important;
  transition: border-color .15s ease !important;
}
.musideo-select .custom-select-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.musideo-select .custom-select-arrow { display: none !important; }
:is(.musideo-select, #importSectionsModal .musideo-select) > .custom-select-trigger::after {
  content: '' !important;
  background: none !important;
  width: 7px !important;
  height: 7px !important;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  right: 16px;
  top: 50%;
  transform: translateY(-70%) rotate(45deg) !important;
  transition: none !important;
}
:is(.musideo-select, #importSectionsModal .musideo-select).open > .custom-select-trigger::after {
  transform: translateY(-20%) rotate(225deg) !important;
}
.musideo-select > .custom-select-trigger:focus-visible { outline: 2px solid #6554df; outline-offset: 2px; }
:is(.musideo-select-popup, #importSectionsModal .musideo-select-popup) {
  box-sizing: border-box !important;
  padding: 0 0 6px !important;
  background: var(--ui2-surface, #fff) !important;
  color: var(--ui2-ink, #24263a) !important;
  border: 1px solid var(--ui2-border, #dfe3ee) !important;
  border-radius: 12px !important;
  box-shadow: 0 10px 30px #24263a26 !important;
  transform: none !important;
  transition: none !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
}
.musideo-select-popup .custom-select-search-box {
  top: 0;
  padding: 10px;
  background: var(--ui2-surface, #fff);
}
.musideo-select-popup .custom-select-search {
  min-height: 36px;
  font-size: 14px;
  outline: none !important;
  box-shadow: none !important;
  background: var(--ui2-canvas, #f6f7fb);
}
.musideo-select-popup .custom-select-search:focus { border-color: #8b80e7; }
:is(.musideo-select-popup, #importSectionsModal .musideo-select-popup) .custom-select-option {
  box-sizing: border-box;
  display: block;
  width: calc(100% - 12px);
  margin: 2px 6px;
  padding: 9px 12px !important;
  font-size: 14px !important;
  line-height: 1.45 !important;
  text-transform: none !important;
  white-space: normal;
  overflow-wrap: anywhere;
  transform: none !important;
  transition: none !important;
  color: inherit;
}
.musideo-select-popup .custom-select-option:is(.selected, .keyboard-active, :hover) { color: var(--ui2-accent, #5142cf); background: var(--ui2-accent-soft, #f0edff); }
.musideo-select-popup .custom-select-option.keyboard-active { box-shadow: inset 3px 0 #6554df; }
@media (max-width: 768px) {
  .musideo-select-popup .custom-select-search { font-size: 16px; }
}

/* Móvil (pantalla estrecha o táctil): la lista es una hoja inferior con filas grandes y fondo oscuro */
.musideo-select-popup.musideo-select-sheet::backdrop { background: rgba(17, 24, 39, .45); }
.musideo-select-popup.musideo-select-sheet {
  border-radius: 18px 18px 0 0 !important;
  border-width: 1px 0 0 !important;
  padding: 18px 0 calc(10px + env(safe-area-inset-bottom)) !important;
  box-shadow: 0 -12px 40px #24263a40 !important;
}
.musideo-select-popup.musideo-select-sheet::before {
  content: ''; position: absolute; top: 7px; left: 50%; width: 38px; height: 4px; margin-left: -19px;
  border-radius: 999px; background: var(--ui2-border, #d0d4e0);
}
.musideo-select-popup.musideo-select-sheet .custom-select-search-box { padding: 8px 14px; }
.musideo-select-popup.musideo-select-sheet .custom-select-search { min-height: 44px; font-size: 16px; }
:is(.musideo-select-popup.musideo-select-sheet) .custom-select-option {
  width: calc(100% - 16px);
  margin: 2px 8px;
  min-height: 48px;
  padding: 12px 14px !important;
  font-size: 16px !important;
  display: flex;
  align-items: center;
}
.musideo-select-popup.musideo-select-sheet .custom-select-option.selected::after { content: '✓'; margin-left: auto; padding-left: 12px; font-weight: 700; }
/* La caja que se toca para abrir también es cómoda en móvil */
@media (max-width: 640px), (pointer: coarse) {
  :is(.musideo-select, #importSectionsModal .musideo-select) > .custom-select-trigger { min-height: 46px !important; font-size: 16px !important; }
}
