/* Keep the real actions as direct children of their existing native viewport. */
#lms-header-tools > [hidden] { display: none !important; }
.lms-tools-carousel__arrow[hidden] { display: none !important; }
.lms-tools-carousel__arrow { display: none; }

@media (min-width: 901px) {
    .lms-header__actions.lms-tools-carousel { position: relative; min-width: 0; }
    .lms-header__actions.lms-tools-carousel--active > #lms-header-tools {
        position: relative;
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: flex-start;
        flex: 0 1 auto;
        box-sizing: border-box;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        min-height: 48px;
        margin: 0;
        padding: 2px;
        gap: 4px;
        overflow-x: auto;
        overflow-y: hidden;
        overscroll-behavior-x: contain;
        scrollbar-width: none;
        scroll-padding-inline: 2px;
        -webkit-overflow-scrolling: touch;
    }
    .lms-header__actions.lms-tools-carousel--active > #lms-header-tools::-webkit-scrollbar { display: none; }
    .lms-header__actions.lms-tools-carousel--active > #lms-header-tools > .lms-icon-btn {
        flex: 0 0 44px;
        box-sizing: border-box;
        width: 44px;
        min-width: 44px;
        max-width: 44px;
        height: 44px;
        min-height: 44px;
        padding: 0;
    }
    .lms-header__actions.lms-tools-carousel--active > #lms-header-tools > .lms-icon-btn:focus-visible {
        outline: 2px solid var(--lms-accent, #825be0);
        outline-offset: 0;
    }
    .lms-header__actions.lms-tools-carousel--overflow > #lms-header-tools {
        width: var(--lms-tools-carousel-width, calc(100% - 64px));
        max-width: calc(100% - 64px);
        margin-inline: auto;
    }
    .lms-header__actions.lms-tools-carousel--active.lms-tools-carousel--overflow > .lms-tools-carousel__arrow {
        position: absolute;
        top: var(--lms-tools-carousel-top, 10px);
        z-index: 1;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        width: 28px;
        min-width: 28px;
        height: 44px;
        min-height: 44px;
        padding: 0;
        border: 0;
        border-radius: var(--lms-radius-sm, 10px);
        color: var(--lms-text);
        background: var(--lms-header-bg, #fff);
        font-family: var(--lms-font-body, inherit);
        cursor: pointer;
    }
    .lms-tools-carousel__prev { left: var(--lms-tools-carousel-left, 0px); }
    .lms-tools-carousel__next { right: var(--lms-tools-carousel-right, 0px); }
    .lms-header__actions .lms-tools-carousel__arrow svg { flex: 0 0 20px; width: 20px; height: 20px; }
    .lms-tools-carousel__arrow[aria-disabled="true"] { opacity: .35; cursor: default; }
    .lms-tools-carousel__arrow:not([aria-disabled="true"]):hover { background: var(--lms-surface, #f7f7f8); }
    .lms-tools-carousel__arrow:focus-visible { outline: 2px solid var(--lms-accent, #825be0); outline-offset: -2px; }
}
