/* Select controls in the member areas use the current BuddyBoss palette. */
select.alcar-choice-native[hidden] {
  display: none !important;
}

body .alcar-choice-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-width: 0;
  min-height: 46px;
  margin: 0;
  padding: 9px 12px;
  border: 1px solid var(--bb-content-border-color);
  border-radius: var(--bb-input-radius);
  background: var(--bb-body-background-color);
  color: var(--bb-body-text-color);
  font: inherit;
  font-size: 14px;
  line-height: 1.4;
  text-align: start;
  box-shadow: none;
  cursor: pointer;
}

body .alcar-choice-trigger:is(:hover, [aria-expanded=true]):not(:disabled) {
  border-color: var(--bb-input-focus-border-color);
  background: var(--bb-content-background-color);
  color: var(--bb-headings-color);
}

.alcar-choice-trigger:disabled {
  opacity: .6;
  cursor: default;
}

.alcar-choice-trigger::after {
  content: "";
  width: 7px;
  height: 7px;
  margin: -3px 3px 0 0;
  flex: 0 0 auto;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  color: var(--bb-alternate-text-color);
  transform: rotate(45deg);
}

.alcar-choice-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.select-wrap:has(.alcar-choice-trigger)::after {
  display: none;
}

body .alcar-choice-dialog {
  position: fixed;
  inset: var(--alcar-choice-top, 12px) auto auto var(--alcar-choice-left, 12px);
  box-sizing: border-box;
  width: min(360px, calc(100vw - 24px));
  max-width: none;
  max-height: min(64dvh, 512px);
  padding: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--bb-content-border-color);
  border-radius: var(--bb-block-radius);
  background: var(--bb-content-background-color);
  color: var(--bb-body-text-color);
  box-shadow: 0 12px 32px rgba(var(--bb-body-background-color-rgb), .55);
  overscroll-behavior: contain;
}

body .alcar-choice-dialog[open] {
  display: flex;
  flex-direction: column;
}

.alcar-choice-dialog::backdrop {
  background: rgba(var(--bb-body-background-color-rgb), .38);
}

.alcar-choice-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 7px 10px 7px 16px;
  border-bottom: 1px solid var(--bb-content-border-color);
}

body .alcar-choice-dialog .alcar-choice-header h2 {
  margin: 0;
  color: var(--bb-headings-color);
  font: inherit;
  font-size: 16px;
  font-weight: 650;
  line-height: 1.3;
}

body .alcar-choice-dialog .alcar-choice-close {
  position: relative;
  flex: 0 0 44px;
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  margin: 0;
  border: 1px solid transparent;
  border-radius: var(--bb-button-radius);
  background: transparent;
  color: var(--bb-alternate-text-color);
  box-shadow: none;
}

.alcar-choice-close::before,
.alcar-choice-close::after {
  position: absolute;
  top: 50%;
  left: calc(50% - 7px);
  width: 14px;
  height: 1.5px;
  border-radius: 1px;
  background: currentColor;
  content: "";
  transform: rotate(45deg);
}

.alcar-choice-close::after {
  transform: rotate(-45deg);
}

body .alcar-choice-dialog .alcar-choice-close:hover {
  color: var(--bb-headings-color);
  background: var(--bb-secondary-button-background-hover);
}

.alcar-choice-list {
  flex: 1 1 auto;
  min-height: 0;
  padding: 6px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

body .alcar-choice-dialog .alcar-choice-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 10px 11px;
  margin: 0;
  border: 1px solid transparent;
  border-radius: var(--bb-button-radius);
  background: transparent;
  color: var(--bb-body-text-color);
  font: inherit;
  font-size: 14px;
  line-height: 1.35;
  text-align: start;
  box-shadow: none;
  white-space: normal;
}

.alcar-choice-option small {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  color: var(--bb-alternate-text-color);
}

body .alcar-choice-dialog .alcar-choice-option[aria-current=true],
body .alcar-choice-dialog .alcar-choice-option:hover:not(:disabled) {
  background: var(--bb-content-alternate-background-color);
  color: var(--bb-headings-color);
}

body .alcar-choice-dialog .alcar-choice-option[aria-current=true] {
  border-color: var(--bb-content-border-color);
  font-weight: 600;
}

.alcar-choice-option[aria-current=true]::after {
  content: "";
  width: 7px;
  height: 12px;
  margin-inline-end: 4px;
  flex: 0 0 auto;
  border: solid var(--bb-primary-color);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

body .alcar-choice-dialog .alcar-choice-option:disabled {
  color: var(--bb-alternate-text-color);
  opacity: .56;
}

body .alcar-choice-trigger:focus-visible,
body .alcar-choice-dialog :is(button, summary):focus-visible {
  outline: 2px solid var(--bb-input-focus-border-color);
  outline-offset: -3px;
}

body .atg .atg-classroom-filter-row .alcar-choice-trigger {
  max-width: 220px;
}

body .atg .atg-search-scope .alcar-choice-trigger {
  width: auto;
  min-height: 44px;
}

body .apx-app .apx-filter-details > summary {
  margin-top: 8px;
  padding-block: 6px;
  border-top: 1px solid var(--bb-content-border-color);
}

@media (max-width: 680px) {
  body #alcar-choice-panel {
    inset: auto 0 max(12px, env(safe-area-inset-bottom));
    width: min(480px, calc(100vw - 24px));
    max-height: min(62dvh, 492px);
    margin-inline: auto;
  }

  body:has(.alcar-choice-dialog[open]) {
    overflow: hidden;
  }

  .alcar-choice-dialog::backdrop {
    background: rgba(var(--bb-body-background-color-rgb), .72);
  }
}

/* The mobile classroom keeps its existing controls inside a compact panel. */
body .alcar-classroom-dialog {
  inset: auto 0 max(12px, env(safe-area-inset-bottom));
  width: min(520px, calc(100vw - 24px));
  max-height: min(76dvh, 680px);
  margin-inline: auto;
}

body.atg-member-area .atg.atg-mode-course.atg-nav-open .alcar-classroom-dialog #atg-classroom-sidebar {
  width: 100% !important;
  height: auto !important;
  max-height: min(76dvh, 680px) !important;
  min-height: 0 !important;
  min-width: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

body.atg-member-area .atg .alcar-classroom-dialog #atg-menu {
  overscroll-behavior-y: contain;
}

body.atg-member-area .atg .alcar-classroom-dialog #atg-mobile-close {
  min-height: 48px;
  border: 0 !important;
  border-bottom: 1px solid var(--bb-content-border-color) !important;
  border-radius: 0 !important;
  background: var(--bb-content-background-color) !important;
}

/* Playback menus remain beside their controls, including in fullscreen. */
body.atg-member-area .atg.atg #atg-screen :is(#atg-speed-panel, #atg-aspect-panel, #atg-volume-panel) {
  border-color: var(--bb-content-border-color) !important;
  border-radius: var(--bb-block-radius) !important;
  background: var(--bb-content-background-color) !important;
  color: var(--bb-body-text-color) !important;
  box-shadow: 0 8px 24px rgba(var(--bb-body-background-color-rgb), .65) !important;
}

body.atg-member-area .atg.atg #atg-screen :is(.atg-dropdown-header, .atg-volume-panel-heading) {
  color: var(--bb-headings-color) !important;
  font-family: inherit;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: normal;
  text-transform: none;
}

body.atg-member-area .atg.atg #atg-screen :is(.atg-speed-pill, .atg-dropdown-item, #atg-volume-mute) {
  border-color: var(--bb-content-border-color) !important;
  border-radius: var(--bb-button-radius) !important;
  background: var(--bb-secondary-button-background-regular) !important;
  color: var(--bb-body-text-color) !important;
  box-shadow: none !important;
}

body.atg-member-area .atg.atg #atg-screen :is(.atg-speed-pill, .atg-dropdown-item).atg-selected {
  border-color: var(--bb-primary-color) !important;
  background: var(--bb-content-alternate-background-color) !important;
  color: var(--bb-headings-color) !important;
}

@media (max-width: 540px) {
  body.atg-member-area .atg.atg #atg-screen #atg-speed-panel {
    width: min(248px, calc(100vw - 48px)) !important;
    max-height: min(148px, calc(56.25vw - 59px)) !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
  }
}
