select:not(.plan-select):not(.hidden-control):not(.mp-native-select) {
  min-height: 38px !important;
  padding: 8px 34px 8px 12px !important;
  border: 1px solid #cfd9e6 !important;
  border-radius: 8px !important;
  color: #14213d !important;
  background:
    linear-gradient(45deg, transparent 50%, #475569 50%) calc(100% - 18px) 50% / 7px 7px no-repeat,
    linear-gradient(135deg, #475569 50%, transparent 50%) calc(100% - 13px) 50% / 7px 7px no-repeat,
    linear-gradient(180deg, #ffffff, #f8fbff) !important;
  font-family: "Trebuchet MS", "Segoe UI", Arial, Helvetica, sans-serif !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  line-height: 1.2 !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  outline: none !important;
  cursor: pointer !important;
  transition: none !important;
}

select:not(.plan-select):not(.hidden-control):not(.mp-native-select):hover {
  border-color: #aab8cb !important;
  background:
    linear-gradient(45deg, transparent 50%, #334155 50%) calc(100% - 18px) 50% / 7px 7px no-repeat,
    linear-gradient(135deg, #334155 50%, transparent 50%) calc(100% - 13px) 50% / 7px 7px no-repeat,
    linear-gradient(180deg, #ffffff, #eefaff) !important;
}

select:not(.plan-select):not(.hidden-control):not(.mp-native-select):focus {
  border-color: #8b5cf6 !important;
  box-shadow: 0 0 0 3px rgba(109, 93, 252, 0.14) !important;
}

select:not(.plan-select):not(.hidden-control):not(.mp-native-select):disabled {
  cursor: not-allowed !important;
  opacity: 0.68 !important;
  background:
    linear-gradient(45deg, transparent 50%, #94a3b8 50%) calc(100% - 18px) 50% / 7px 7px no-repeat,
    linear-gradient(135deg, #94a3b8 50%, transparent 50%) calc(100% - 13px) 50% / 7px 7px no-repeat,
    #f8fafc !important;
}

select:not(.plan-select):not(.hidden-control):not(.mp-native-select) option {
  color: #14213d;
  background: #ffffff;
  font-family: "Trebuchet MS", "Segoe UI", Arial, Helvetica, sans-serif;
  font-size: 13px;
  font-weight: 800;
}

select:not(.plan-select):not(.hidden-control):not(.mp-native-select) option:checked {
  color: #2f246b;
  background: #eef2ff;
}

select:not(.plan-select):not(.hidden-control):not(.mp-native-select) option:hover {
  color: #2f246b;
  background: #f5f3ff;
}

.mp-native-select {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.mp-select {
  position: relative;
  width: 100%;
  font-family: "Trebuchet MS", "Segoe UI", Arial, Helvetica, sans-serif;
}

.mp-select.open {
  z-index: 40;
}

.mp-select-backdrop {
  position: fixed;
  inset: 0;
  z-index: 35;
  display: none;
  background: transparent;
}

.mp-select-backdrop.active {
  display: block;
}

.mp-select-button {
  width: 100%;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border: 1px solid #cfd9e6;
  border-radius: 8px;
  color: #14213d;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
  outline: none;
  box-shadow: none !important;
  transform: none !important;
  filter: none !important;
  transition: none !important;
  animation: none !important;
}

.mp-select-button::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid #475569;
  border-bottom: 2px solid #475569;
  transform: translateY(-2px) rotate(45deg);
  flex: 0 0 auto;
  transition: none !important;
  animation: none !important;
}

.mp-select-button:hover {
  border-color: #aab8cb;
  background: linear-gradient(180deg, #ffffff, #eefaff);
  transition: none !important;
  animation: none !important;
}

.mp-select.open .mp-select-button {
  border-color: #8b5cf6;
  background: linear-gradient(180deg, #ffffff, #f5f3ff);
  box-shadow: 0 0 0 3px rgba(109, 93, 252, 0.14);
  transition: none !important;
  animation: none !important;
}

.mp-select-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 120;
  display: none;
  max-height: 260px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid #b8c6d8;
  border-radius: 10px;
  background: #ffffff !important;
  box-shadow:
    0 18px 34px rgba(15, 23, 42, 0.18),
    0 6px 12px rgba(15, 23, 42, 0.10);
}

.mp-select.open .mp-select-menu {
  display: grid;
  gap: 0;
}

.mp-select-menu.drop-up {
  top: auto;
  bottom: calc(100% + 6px);
}

.mp-select-option {
  width: 100%;
  min-height: 32px;
  padding: 7px 10px;
  border: 0;
  border-radius: 7px;
  color: #14213d;
  background: transparent !important;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
  box-shadow: none !important;
  transform: none !important;
  filter: none !important;
  transition: background 0.12s ease, color 0.12s ease !important;
}

.mp-select-option:hover,
.mp-select-option.active,
.mp-select-option.is-typeahead-active {
  color: #2f246b;
  background: linear-gradient(135deg, #f5f3ff, #eefaff) !important;
  box-shadow: none !important;
  transform: none !important;
  filter: none !important;
}

.mp-select-option:disabled {
  cursor: default;
  color: #94a3b8;
  background: #f8fafc !important;
}

.mp-select-empty {
  padding: 10px 12px;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.mp-multiselect .mp-select-button {
  align-items: flex-start;
  min-height: 38px;
  white-space: normal;
  line-height: 1.35;
}

.mp-multiselect .mp-select-menu {
  max-height: 280px;
}

.mp-multiselect .mp-select-option.active {
  color: #4338ca;
  background: linear-gradient(135deg, #f5f3ff, #eef2ff) !important;
}

.mp-multiselect .mp-select-option.active::before {
  content: "✓ ";
  color: #6d5dfc;
  font-weight: 900;
}

/* Mobile: shared floating dropdown (all pages using .mp-select) */
@media (max-width: 768px) {
  .field,
  .tutor-chat-field,
  .tutor-sort-field,
  .filters .field {
    position: relative;
    z-index: 1;
  }

  .field:has(.mp-select.open),
  .tutor-chat-field:has(.mp-select.open),
  .tutor-sort-field:has(.mp-select.open),
  .filters .field:has(.mp-select.open) {
    z-index: 50;
  }

  .mp-select {
    position: relative;
    width: 100%;
  }

  .mp-select.open {
    z-index: 50;
  }

  .mp-select.open .mp-select-menu {
    position: absolute !important;
    top: calc(100% + 4px) !important;
    left: 0 !important;
    right: 0 !important;
    bottom: auto !important;
    width: 100% !important;
    max-height: min(240px, 42vh);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 9999 !important;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow:
      0 10px 15px -3px rgba(0, 0, 0, 0.1),
      0 4px 6px -2px rgba(0, 0, 0, 0.05);
  }

  .mp-select.open .mp-select-menu.drop-up {
    top: auto !important;
    bottom: calc(100% + 4px) !important;
  }

  .mp-select-option {
    min-height: 44px;
    padding: 10px 12px;
  }

  .card:has(.mp-select.open),
  .panel:has(.mp-select.open),
  .card-body:has(.mp-select.open),
  .panel-body:has(.mp-select.open),
  .tutor-search-panel:has(.mp-select.open),
  .tutor-search-body:has(.mp-select.open),
  .tutor-search-row:has(.mp-select.open),
  .tutor-results-section:has(.mp-select.open),
  .filters:has(.mp-select.open),
  .ask-question-modal:has(.mp-select.open),
  .ask-question-modal-body:has(.mp-select.open) {
    overflow: visible;
  }

  .card:has(.mp-select.open),
  .panel:has(.mp-select.open),
  .tutor-marketplace-page .tutor-search-panel:has(.mp-select.open),
  .tutor-marketplace-page .tutor-results-section:has(.mp-select.open) {
    z-index: 20;
  }

  .tutor-sort-field .mp-select.open .mp-select-menu {
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    min-width: 0 !important;
  }
}
