/**
 * Question Library compact dashboard layer.
 *
 * New library UI corrections should live here instead of inside PHP templates.
 */
.ttc-role-student .ttc-library-wrapper .ttc-library-k12-active .ttc-al-top-bar {
    grid-template-columns: minmax(250px, auto) minmax(0, 1fr) !important;
    gap: 10px !important;
    padding: 8px 12px !important;
}

.ttc-role-student .ttc-library-wrapper .ttc-library-k12-active .ttc-al-logo-title {
    font-size: 20px !important;
}

.ttc-role-student .ttc-library-wrapper .ttc-library-k12-active .ttc-level-library-badge,
.ttc-role-student .ttc-library-wrapper .ttc-library-k12-active .ttc-library-mastery-card-inline,
.ttc-role-student .ttc-library-wrapper .ttc-library-k12-active .ttc-al-search-box,
.ttc-role-student .ttc-library-wrapper .ttc-library-k12-active .ttc-al-advanced-search-btn,
.ttc-role-student .ttc-library-wrapper .ttc-library-k12-active .ttc-al-lang-btn,
.ttc-role-student .ttc-library-wrapper .ttc-library-k12-active .ttc-library-tools-menu summary {
    height: 34px !important;
    min-height: 34px !important;
    border-radius: 9px !important;
}

.ttc-role-student .ttc-library-wrapper .ttc-library-k12-active .ttc-al-view-toggle {
    display: none !important;
}

.ttc-role-student .ttc-library-wrapper .ttc-library-k12-active .ttc-al-actions-right {
    gap: 6px !important;
}

.ttc-role-student .ttc-library-wrapper .ttc-library-k12-active .ttc-library-mastery-card-inline {
    min-width: 128px !important;
    padding: 0 10px !important;
}

.ttc-role-student .ttc-library-wrapper .ttc-library-k12-active .ttc-al-search-box {
    width: clamp(170px, 20vw, 260px) !important;
}

.ttc-role-student .ttc-library-wrapper .ttc-library-k12-active .ttc-al-advanced-search-btn {
    padding: 0 10px !important;
    font-size: 11px !important;
}

.ttc-role-student .ttc-library-wrapper .ttc-library-k12-active .ttc-al-lang-btn {
    min-width: 88px !important;
    font-size: 11px !important;
}

.ttc-role-student .ttc-library-wrapper .ttc-library-k12-active .ttc-filter-bar {
    display: grid !important;
    grid-template-columns: auto repeat(4, minmax(130px, 1fr)) auto !important;
    align-items: center !important;
    gap: 7px !important;
    padding: 6px 12px !important;
    overflow: visible !important;
}

.ttc-role-student .ttc-library-wrapper .ttc-library-k12-active .ttc-filter-label {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    min-width: max-content !important;
    color: var(--ql-text-muted) !important;
    font-size: 12px !important;
    font-weight: 700 !important;
}

.ttc-role-student .ttc-library-wrapper .ttc-library-k12-active .ttc-filter-label-icon {
    font-size: 11px !important;
    line-height: 1 !important;
}

.ttc-role-student .ttc-library-wrapper .ttc-library-k12-active .ttc-filter-select,
.ttc-role-student .ttc-library-wrapper .ttc-library-k12-active #ttc_clear_filters {
    width: 100% !important;
    min-width: 0 !important;
    height: 32px !important;
    min-height: 32px !important;
    font-size: 12px !important;
}

.ttc-role-student .ttc-library-wrapper .ttc-library-k12-active #ttc_clear_filters {
    padding: 0 10px !important;
    white-space: nowrap !important;
}

@media (max-width: 1180px) {
    .ttc-role-student .ttc-library-wrapper .ttc-library-k12-active .ttc-filter-bar {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .ttc-role-student .ttc-library-wrapper .ttc-library-k12-active .ttc-filter-bar > div:first-child {
        grid-column: 1 / -1 !important;
    }
}
