/* Desktop protocol menu preference. Reuses the sidebar and mobile theme tokens. */
#aside-nav .bf-menu-preferences {
  display: none;
}

@media (min-width: 1280px) {
  #aside-nav .bf-menu-preferences:not([hidden]) {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 44px;
    margin-block: -8px;
    color: var(--bf-sidebar-muted);
    font-size: 14px;
  }

  #aside-nav .bf-menu-preference-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    line-height: 1.4;
  }

  #aside-nav .bf-menu-auto-expand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 52px;
    min-height: 44px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
  }

  #aside-nav .bf-menu-preference-info {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: inherit;
    cursor: help;
  }

  #aside-nav .bf-menu-auto-expand:focus-visible,
  #aside-nav .bf-menu-preference-info:focus-visible {
    outline: 2px solid var(--color-blue-close);
    outline-offset: 2px;
  }

  #aside-nav .bf-menu-switch-track {
    display: flex;
    align-items: center;
    width: 44px;
    height: 26px;
    padding: 3px;
    border-radius: 999px;
    background: var(--bf-sidebar-soft-border);
    box-shadow: inset 0 0 0 1px var(--bf-sidebar-muted);
    transition: background-color 160ms ease;
  }

  #aside-nav .bf-menu-switch-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--color-base-white);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: transform 160ms ease;
  }

  #aside-nav .bf-menu-auto-expand[aria-checked="true"] .bf-menu-switch-track {
    background: var(--color-blue-close);
    box-shadow: none;
  }

  #aside-nav .bf-menu-auto-expand[aria-checked="true"] .bf-menu-switch-thumb {
    transform: translateX(18px);
  }

  #aside-nav .bf-menu-preference-help {
    position: absolute;
    top: calc(100% + 4px);
    inset-inline: 0;
    z-index: 5;
    visibility: hidden;
    padding: 10px 12px;
    border: 1px solid var(--bf-sidebar-soft-border);
    border-radius: 10px;
    background: var(--bf-sidebar-heading);
    color: var(--bf-sidebar-bg);
    box-shadow: var(--bf-sidebar-card-shadow);
    font-size: 12px;
    line-height: 1.5;
    pointer-events: none;
  }

  #aside-nav .bf-menu-preferences:has(.bf-menu-preference-info:hover) .bf-menu-preference-help,
  #aside-nav .bf-menu-preferences:has(.bf-menu-preference-info:focus-visible) .bf-menu-preference-help {
    visibility: visible;
  }
}

@media (prefers-reduced-motion: reduce) {
  #aside-nav .bf-menu-switch-track,
  #aside-nav .bf-menu-switch-thumb {
    transition: none;
  }
}

@media (forced-colors: active) {
  #aside-nav .bf-menu-switch-track {
    border: 1px solid ButtonText;
    background: Canvas;
  }

  #aside-nav .bf-menu-auto-expand[aria-checked="true"] .bf-menu-switch-track {
    background: Highlight;
  }

  #aside-nav .bf-menu-switch-thumb {
    background: ButtonText;
  }
}
