.dark-mode .bg-image {
    filter: brightness(50%);
}

/* Public language selector. */
.cq-language-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 11rem;
    white-space: nowrap;
}
.cq-language-menu {
    width: max-content;
    min-width: 10.5rem;
    max-width: calc(100vw - 1rem);
    border: 1px solid rgba(0, 0, 0, .09);
    border-radius: .75rem;
    box-shadow: 0 .75rem 2rem rgba(0, 0, 0, .16);
}
.cq-language-options {
    display: grid;
    grid-template-columns: repeat(2, max-content);
    gap: .25rem;
    max-height: min(25rem, 62vh);
    overflow-y: auto;
    overscroll-behavior: contain;
}
.cq-language-entry {
    min-width: 7rem;
}
.cq-language-option {
    display: flex;
    align-items: center;
    min-height: 2.65rem;
    padding: .55rem .65rem;
    border-radius: .5rem;
    color: #343a40;
    gap: .5rem;
}
.cq-language-option:hover,
.cq-language-option:focus {
    color: #075985;
    background-color: #e8f4fa;
}
.cq-language-option.active,
.cq-language-option.active:hover,
.cq-language-option.active:focus {
    color: #075985;
    background-color: #d9effa;
}
.cq-language-check {
    flex: 0 0 1rem;
    width: 1rem;
    color: #009ad9;
    text-align: center;
}
.cq-language-name {
    min-width: 0;
    overflow: hidden;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dark-mode .cq-language-menu {
    background-color: #252d36;
    border-color: #3b4652;
    box-shadow: 0 .75rem 2rem rgba(0, 0, 0, .38);
}
.dark-mode .cq-language-menu .dropdown-header {
    color: #aeb9c5;
}
.dark-mode .cq-language-option {
    color: #e8edf3;
}
.dark-mode .cq-language-option:hover,
.dark-mode .cq-language-option:focus {
    color: #fff;
    background-color: #303a45;
}
.dark-mode .cq-language-option.active,
.dark-mode .cq-language-option.active:hover,
.dark-mode .cq-language-option.active:focus {
    color: #eaf8ff;
    background-color: #13445a;
}
@media (max-width: 575.98px) {
    .cq-language-menu {
        width: min(16rem, calc(100vw - 1rem));
        min-width: 0;
    }
    .cq-language-options {
        grid-template-columns: 1fr;
        max-height: 64vh;
    }
}

/* Unified admin/settings style */
.cq-admin-page .block-rounded,
.cq-admin-card {
    border-radius: 1rem;
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.05);
}

.cq-admin-card-header {
    border-top-left-radius: 1rem;
    border-top-right-radius: 1rem;
}

.cq-admin-page .nav-tabs-block .nav-link {
    font-weight: 600;
}

.cq-filter-row {
    background: rgba(0, 0, 0, 0.015);
    border-radius: 1rem;
    padding: 1rem;
}

/* Subject olympiad filters. */
.cq-quiz-filter-panel {
    border: 1px solid rgba(0, 0, 0, .07);
    box-shadow: 0 .35rem 1.1rem rgba(0, 0, 0, .06);
}
.cq-quiz-filter-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
    align-items: end;
    gap: .75rem;
}
.cq-quiz-filter-field {
    min-width: 0;
}
.cq-quiz-filter-label {
    display: flex;
    align-items: center;
    margin-bottom: .3rem;
    color: #4b5563;
    font-size: .74rem;
    font-weight: 700;
    gap: .35rem;
}
.cq-quiz-filter-select {
    min-height: 2.4rem;
    padding-top: .35rem;
    padding-bottom: .35rem;
    border-color: #d7dde3;
    border-radius: .65rem;
    background-color: #fff;
    font-size: .875rem;
}
.cq-quiz-filter-select:focus {
    border-color: #55b8e5;
    box-shadow: 0 0 0 .2rem rgba(0, 154, 217, .14);
}
.cq-quiz-filter-actions {
    display: flex;
    align-items: center;
    gap: .45rem;
    padding-bottom: .05rem;
}
.cq-quiz-filter-count {
    min-width: 4rem;
    padding: .38rem .6rem;
    color: #075985;
    background-color: #d9effa;
    font-size: .78rem;
}
.cq-quiz-filter-reset-text {
    margin-inline-start: .35rem;
}
.dark-mode .cq-quiz-filter-panel {
    background-color: #252d36 !important;
    border-color: #3b4652;
    box-shadow: 0 .35rem 1.1rem rgba(0, 0, 0, .22);
}
.dark-mode .cq-quiz-filter-label {
    color: #d7dee7;
}
.dark-mode .cq-quiz-filter-select {
    color: #edf2f7;
    background-color: #1b2128;
    border-color: #46515d;
}
.dark-mode .cq-quiz-filter-select:focus {
    border-color: #49add9;
    box-shadow: 0 0 0 .2rem rgba(73, 173, 217, .18);
}
.dark-mode .cq-quiz-filter-count {
    color: #dff5ff;
    background-color: #13445a;
}
@media (max-width: 767.98px) {
    .cq-olympiad-hero > .hero-bubbles > .content {
        padding-top: 88px !important;
    }
    .cq-quiz-filter-panel {
        padding: .65rem !important;
        border-radius: .85rem !important;
    }
    .cq-quiz-filter-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: .45rem;
    }
    .cq-quiz-filter-label {
        justify-content: center;
        margin-bottom: .2rem;
        font-size: .8rem;
    }
    .cq-quiz-filter-label-text {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }
    .cq-quiz-filter-select {
        width: 100%;
        min-height: 2.35rem;
        padding: .3rem 1.65rem .3rem .45rem;
        background-position: right .45rem center;
        font-size: .78rem;
    }
    .cq-quiz-filter-actions {
        grid-column: 1 / -1;
        justify-content: space-between;
        padding-top: .5rem;
        border-top: 1px solid rgba(0, 0, 0, .07);
    }
    .dark-mode .cq-quiz-filter-actions {
        border-top-color: #3b4652;
    }
    .cq-quiz-filter-actions .btn {
        padding: .3rem .55rem;
    }
    .cq-quiz-filter-reset-text {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }
}

.cq-bg-card {
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 0.9rem;
    padding: 0.8rem;
    background: #fff;
}

.cq-bg-preview-frame {
    height: 118px;
    border-radius: 0.7rem;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.cq-bg-thumb {
    display: block;
    width: auto !important;
    height: auto !important;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border: 0;
    border-radius: 0;
}

.cq-bg-empty {
    width: 100%;
    height: 118px;
    border-radius: 0.7rem;
    border: 1px dashed rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    background: rgba(0, 0, 0, 0.02);
    text-align: center;
    padding: 0.5rem;
}

.cq-bg-card .form-control[type="file"] {
    font-size: 0.74rem;
}

.cq-test-card {
    border-radius: 1rem;
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.05);
}

.cq-test-question {
    font-size: 1.05rem;
    line-height: 1.55;
}

@media (max-width: 576px) {
    .cq-bg-thumb,
    .cq-bg-empty {
        height: 120px;
    }
}


/* Active backend menu marker */
.nav-main-link.active,
.nav-main-item.open > .nav-main-link {
    background: rgba(6, 101, 208, 0.10);
    color: #0665d0;
    border-radius: 0.65rem;
    font-weight: 700;
}
.nav-main-link.active .nav-main-link-icon,
.nav-main-item.open > .nav-main-link .nav-main-link-icon {
    color: #0665d0;
}

/* Visual document editor */
.cq-doc-editor-wrap {
    background: #f6f7fb;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 1rem;
    padding: 1rem;
    overflow: auto;
}
.cq-doc-page {
    position: relative;
    width: min(100%, 560px);
    aspect-ratio: 210 / 297;
    margin: 0 auto;
    background: #fff;
    border-radius: 0.6rem;
    overflow: hidden;
    box-shadow: 0 0.8rem 2rem rgba(0, 0, 0, 0.12);
}
.cq-doc-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    user-select: none;
}
.cq-doc-layer {
    position: absolute;
    min-width: 8px;
    min-height: 8px;
    border: 1px dashed rgba(6, 101, 208, 0.25);
    background: rgba(255, 255, 255, 0.10);
    cursor: move;
    overflow: hidden;
    padding: 2px;
    line-height: 1.15;
}
.cq-doc-layer:hover,
.cq-doc-layer.active {
    border: 2px solid #0665d0;
    background: rgba(6, 101, 208, 0.07);
    z-index: 20;
}
.cq-doc-layer img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}
.cq-doc-layer-qrcode {
    display: flex;
    align-items: center;
    justify-content: center;
    background: repeating-linear-gradient(45deg, #fff, #fff 4px, #e9ecef 4px, #e9ecef 8px);
    color: #222;
    font-size: 10px;
    text-align: center;
}
.cq-editor-panel {
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 1rem;
    padding: 1rem;
    background: #fff;
    position: sticky;
    top: 1rem;
}
.cq-editor-tools .btn {
    margin-right: 0.35rem;
    margin-bottom: 0.35rem;
}
.cq-appeal-focus .block {
    max-width: 1180px;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 576px) {
    .cq-bg-preview-frame,
    .cq-bg-empty {
        height: 96px;
    }
}

/* Image selection and lightbox */
.cq-image-library-thumb {
    width: 72px;
    height: 52px;
    object-fit: contain;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 0.5rem;
    background: #f8f9fa;
    padding: 2px;
}
.cq-lightboxable,
.cq-bg-thumb,
.cq-category-photo {
    cursor: zoom-in;
}
.cq-lightbox-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10800;
    background: rgba(0, 0, 0, 0.86);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.cq-lightbox-backdrop img {
    max-width: 96vw;
    max-height: 92vh;
    object-fit: contain;
    border-radius: 0.5rem;
    background: #fff;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.4);
}
.cq-lightbox-close {
    position: fixed;
    top: 16px;
    right: 20px;
    z-index: 10801;
    border: 0;
    border-radius: 999px;
    width: 42px;
    height: 42px;
    font-size: 24px;
    color: #fff;
    background: rgba(255, 255, 255, 0.16);
}
.subject-thumb,
.subject-preview,
.cq-admin-page img:not([data-no-lightbox="1"]) {
    cursor: zoom-in;
}

/* Comfortable bottom spacing for backend pages */
.content {
    padding-bottom: 3.5rem !important;
}
.block:last-child,
.content > .row:last-child {
    margin-bottom: 1.5rem;
}
.cq-site-edit-form:last-child {
    margin-bottom: 1rem !important;
}

/* Image path previews and extra card spacing */
.cq-image-path-preview {
    width: 76px;
    height: 56px;
    flex: 0 0 76px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 0.55rem;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    text-decoration: none;
    color: #6c757d;
    font-size: 0.72rem;
    text-align: center;
    padding: 0.25rem;
}
.cq-image-path-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.cq-image-path-preview-empty {
    border-style: dashed;
}
.cq-admin-page .block-content {
    padding-bottom: 1.25rem;
}
.cq-admin-page .block-content-full {
    padding-bottom: 1.25rem !important;
}
.cq-admin-page .block.bg-body-light .block-content,
.cq-admin-page .cq-site-edit-form {
    padding-bottom: 1.5rem !important;
}

/* Extra bottom breathing room for utility admin cards */
.cq-admin-page .block-content.pb-5,
.cq-admin-page .cq-site-edit-form {
    padding-bottom: 2rem !important;
}
.cq-admin-page .btn.mb-2:last-child {
    margin-bottom: .75rem !important;
}

/* Settings cards and modals need an explicit surface because Codebase keeps
   Bootstrap modal backgrounds transparent by default. */
.cq-settings-card,
.cq-admin-page .bg-body-light {
    background-color: #fff !important;
    border-color: #e4e7ed !important;
}
.cq-settings-modal .modal-content {
    color: #2c3034;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 1rem;
    box-shadow: 0 1.5rem 4rem rgba(0, 0, 0, 0.28);
    overflow: hidden;
}
.cq-settings-modal .modal-header,
.cq-settings-modal .modal-footer {
    background: #f6f7f9;
    border-color: #e4e7ed;
}
.cq-settings-modal .modal-header {
    border-bottom-width: 1px;
}
.cq-settings-modal .modal-footer {
    border-top-width: 1px;
}
.cq-settings-modal .btn-primary,
.cq-admin-page .btn-primary {
    color: #fff !important;
    background-color: #0284c7 !important;
    border-color: #0284c7 !important;
}
.cq-settings-modal .btn-alt-secondary,
.cq-admin-page .btn-alt-secondary {
    color: #2c3034;
    background-color: #e9ecef;
    border-color: #d9dde2;
}
.cq-settings-modal .form-control,
.cq-settings-modal .form-select {
    color: #2c3034;
    background-color: #fff;
    border-color: #ced4da;
}
.dark-mode .cq-settings-card,
.dark-mode .cq-admin-page .bg-body-light,
.dark-mode .cq-settings-modal .modal-content {
    color: #c5cdd8;
    background: #262a2f !important;
    border-color: #3b424a !important;
}
.dark-mode .cq-settings-modal .modal-header,
.dark-mode .cq-settings-modal .modal-footer {
    background: #333a40;
    border-color: #454e57;
}
.dark-mode .cq-settings-modal .form-control,
.dark-mode .cq-settings-modal .form-select {
    color: #f1f3f5;
    background-color: #1f2327;
    border-color: #4a545e;
}
.cq-home-video-row,
.cq-home-upload-card,
.cq-home-video-empty {
    background: #f8f9fa;
    border-color: #dfe3e7 !important;
}
.cq-video-order-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 31px;
    color: #014f77;
    background: #d9effa;
    border-radius: .45rem;
    font-weight: 700;
}
.dark-mode .cq-home-video-row,
.dark-mode .cq-home-upload-card,
.dark-mode .cq-home-video-empty {
    background: #202429;
    border-color: #3b424a !important;
}
.dark-mode .cq-video-order-number {
    color: #9edcff;
    background: #123e54;
}
.cq-ad-cache-table {
    max-height: 420px;
    overflow: auto;
}
.cq-ad-status-card {
    background: #f8f9fa;
    border-color: #dfe3e7 !important;
    overflow-wrap: anywhere;
}
.dark-mode .cq-ad-status-card {
    background: #202429;
    border-color: #3b424a !important;
}

/* Native homepage video background. */
.cq-home-hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 500px;
    overflow: hidden;
    background: #e9ecef;
}
.cq-home-hero-height-compact { height: 500px; }
.cq-home-hero-height-large { height: 75vh; min-height: 560px; }
.cq-home-hero-height-full { height: 100vh; min-height: 500px; }
.cq-home-hero-no-video {
    background:
        radial-gradient(circle at 18% 24%, rgba(0, 154, 217, .16), transparent 32%),
        radial-gradient(circle at 82% 70%, rgba(101, 163, 13, .14), transparent 34%),
        linear-gradient(135deg, #f8fbfd 0%, #e9f4f9 48%, #f4f8ec 100%);
}
.cq-home-header-spacer {
    height: 4.25rem;
    background: #fff;
    border-bottom: 1px solid rgba(0, 0, 0, .04);
}
.dark-mode .cq-home-hero-no-video {
    background:
        radial-gradient(circle at 18% 24%, rgba(0, 154, 217, .18), transparent 32%),
        radial-gradient(circle at 82% 70%, rgba(101, 163, 13, .14), transparent 34%),
        linear-gradient(135deg, #20252a 0%, #26343b 48%, #293128 100%);
}
.dark-mode .cq-home-hero {
    background-color: #111820;
}
.dark-mode .cq-home-hero-overlay {
    background-color: #08131d !important;
    opacity: .58 !important;
}
.dark-mode .cq-home-hero-content h1 {
    color: #fff !important;
    text-shadow: 0 2px 20px rgba(0, 0, 0, .72);
}
.dark-mode .cq-home-hero-content .btn-light {
    color: #111827;
    background-color: #f8fafc;
    border-color: #fff;
    box-shadow: 0 .25rem 1rem rgba(0, 0, 0, .3);
}
.dark-mode .cq-home-header-spacer {
    background: #31373d;
    border-bottom-color: rgba(255, 255, 255, .06);
}
.cq-home-hero-video,
.cq-home-hero-poster {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.cq-home-hero-overlay {
    position: absolute;
    inset: 0;
}
.cq-home-hero-content {
    position: relative;
    z-index: 2;
    width: 100%;
}
.cq-home-quiz-grid > [class*="col-"] {
    min-width: 0;
}
.cq-home-quiz-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.cq-home-quiz-card > .block-content:last-child {
    flex: 1 1 auto;
}
.dark-mode #main-container > .bg-body-light {
    color: #d7dee7;
    background-color: #1b2128 !important;
    border-top: 1px solid #303943;
}
.dark-mode #main-container .content-heading {
    color: #f3f6f9;
    border-bottom-color: #36404b;
}
.dark-mode #main-container .content-heading .btn-outline-secondary {
    color: #c7d0da;
    border-color: #65717e;
}
.dark-mode #main-container .content-heading .btn-outline-secondary:hover,
.dark-mode #main-container .content-heading .btn-outline-secondary:focus {
    color: #111820;
    background-color: #e7edf3;
    border-color: #e7edf3;
}
.dark-mode .cq-home-quiz-card {
    color: #e8edf3 !important;
    background-color: #252d36 !important;
    border: 1px solid #36404b;
    box-shadow: 0 .25rem .9rem rgba(0, 0, 0, .22);
}
.dark-mode .cq-home-quiz-card .fs-lg {
    color: #f8fafc;
}
.dark-mode .cq-home-quiz-card .text-muted {
    color: #aeb9c5 !important;
}
.cq-ad-section {
    border-top: 1px solid #e4e7ed;
}
.cq-ad-disclosure {
    margin: -.25rem 0 .75rem;
    color: #8a9199;
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.cq-ad-product-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.cq-ad-product-image-link {
    position: relative;
    display: block;
    height: 225px;
    overflow: hidden;
    background: #eef0f2;
}
.cq-ad-product-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .2s ease;
}
.cq-ad-product-image-link:hover .cq-ad-product-image {
    transform: scale(1.025);
}
.cq-ad-product-brand {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    max-width: calc(100% - 3rem);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cq-ad-fallback-image {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: 260px;
    margin: 0 auto;
    object-fit: contain;
    border-radius: .5rem;
}
.dark-mode .cq-ad-section {
    color: #d7dee7;
    background-color: #1b2128 !important;
    border-top-color: #36404b;
    border-bottom: 1px solid #303943;
}
.dark-mode .cq-ad-section .content-heading {
    color: #f3f6f9;
    border-bottom-color: #36404b;
}
.dark-mode .cq-ad-disclosure {
    color: #9da9b6;
}
.dark-mode .cq-ad-product-image-link {
    background: #202429;
}
.dark-mode .cq-ad-product-image-link::after {
    position: absolute;
    z-index: 1;
    inset: 0;
    background: rgba(7, 13, 20, .42);
    content: "";
    pointer-events: none;
    transition: background-color .2s ease;
}
.dark-mode .cq-ad-product-image-link:hover::after,
.dark-mode .cq-ad-product-image-link:focus::after {
    background: rgba(7, 13, 20, .34);
}
.dark-mode .cq-ad-product-brand {
    z-index: 2;
}
.dark-mode .cq-ad-product-card {
    color: #e8edf3;
    background-color: #252d36 !important;
    border: 1px solid #36404b;
    box-shadow: 0 .25rem .9rem rgba(0, 0, 0, .22);
}
.dark-mode .cq-ad-product-card > .block-content:not(.bg-body-light) {
    background-color: #252d36;
}
.dark-mode .cq-ad-product-card .text-dark {
    color: #f1f3f5 !important;
}
.dark-mode .cq-ad-product-card .block-content.bg-body-light {
    background-color: #202730 !important;
}
.dark-mode .cq-ad-product-card .text-muted {
    color: #b5c0cc !important;
}
.dark-mode .cq-ad-fallback-image {
    filter: brightness(.66) contrast(1.04);
}
.dark-mode #page-footer {
    color: #d7dee7;
    background-color: #1b2128 !important;
}
.dark-mode #page-footer > .content .block {
    color: #e8edf3;
    background-color: #252d36;
    border: 1px solid #36404b;
}
.dark-mode #page-footer > .content .text-muted {
    color: #aeb9c5 !important;
}
.dark-mode #page-footer .content-heading {
    color: #f3f6f9;
    border-bottom-color: #36404b;
}
.dark-mode #page-footer .border-top {
    border-top-color: #36404b !important;
}
@media (max-width: 767.98px) {
    .cq-home-hero-height-compact,
    .cq-home-hero-height-large,
    .cq-home-hero-height-full {
        height: 70vh;
        min-height: 460px;
    }
}

/* Subjects catalogue */
.cq-subjects-hero {
    min-height: 190px;
}
.cq-subjects-breadcrumb-content {
    padding-top: 120px;
}
.cq-subjects-content {
    padding-top: 2rem;
}
.cq-subjects-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1rem;
}
.cq-subjects-heading > div:first-child {
    flex: 0 0 auto;
}
.cq-subjects-heading-search {
    flex: 1 1 auto;
    min-width: 0;
}
.cq-subjects-tools {
    display: flex;
    align-items: stretch;
    flex-direction: column;
    gap: .6rem;
    margin-bottom: 1rem;
    padding: .75rem .9rem;
}
.cq-subjects-search-wrap {
    width: 100%;
    max-width: none;
    min-width: 0;
    margin-left: auto;
}
.cq-subjects-search-wrap .input-group-text,
.cq-subjects-search-wrap .form-control {
    min-height: 42px;
}
.cq-subjects-initials {
    display: flex;
    flex: 1 1 auto;
    flex-wrap: wrap;
    justify-content: center;
    gap: .35rem;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding: .15rem 0;
}
.cq-subjects-initial {
    min-width: 32px;
    min-height: 32px;
    flex: 0 0 auto;
    padding-right: .55rem;
    padding-left: .55rem;
}
.cq-subjects-initial-select {
    display: none;
}
.cq-subjects-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}
.cq-subject-card {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr) 20px;
    align-items: center;
    min-width: 0;
    min-height: 106px;
    overflow: hidden;
    color: var(--bs-body-color);
    background: var(--bs-body-bg);
    border: 1px solid #e4e7ed;
    border-radius: .6rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
    text-decoration: none;
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.cq-subject-card:hover,
.cq-subject-card:focus-visible {
    color: var(--bs-link-hover-color, #0284c7);
    border-color: rgba(2, 132, 199, .55);
    box-shadow: 0 .4rem 1.2rem rgba(0, 0, 0, .09);
    transform: translateY(-2px);
}
.cq-subject-card:focus-visible {
    outline: 3px solid rgba(2, 132, 199, .22);
    outline-offset: 2px;
}
.cq-subject-card[hidden] {
    display: none !important;
}
.cq-subject-card-image-wrap {
    align-self: stretch;
    min-height: 104px;
    overflow: hidden;
    background-color: #eef0f2;
}
.cq-subject-card-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.cq-subject-card-name {
    min-width: 0;
    padding: .75rem .85rem;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
    overflow-wrap: anywhere;
}
.cq-subject-card-arrow {
    margin-right: .85rem;
    color: #9aa5b1;
    font-size: .75rem;
    transition: transform .16s ease;
}
.cq-subject-card:hover .cq-subject-card-arrow,
.cq-subject-card:focus-visible .cq-subject-card-arrow {
    color: currentColor;
    transform: translateX(2px);
}
.cq-subjects-empty {
    margin-top: 1rem;
    padding: 3rem 1rem;
    color: var(--bs-secondary-color);
    background: var(--bs-body-bg);
    border: 1px dashed #cbd2da;
    border-radius: .6rem;
}
.cq-subjects-empty .fa {
    font-size: 1.75rem;
}
.dark-mode .cq-subjects-tools,
.dark-mode .cq-subject-card,
.dark-mode .cq-subjects-empty {
    color: #e8edf3;
    background-color: #252d36 !important;
    border-color: #36404b;
}
.dark-mode .cq-subject-card-image-wrap {
    background-color: #202730;
}
.dark-mode .cq-subject-card:hover,
.dark-mode .cq-subject-card:focus-visible {
    color: #fff;
    border-color: #0284c7;
    box-shadow: 0 .4rem 1.2rem rgba(0, 0, 0, .24);
}
.dark-mode .cq-subject-card-arrow {
    color: #8e9baa;
}
.dark-mode .cq-subjects-empty {
    color: #aeb9c5;
    border-color: #4a5663;
}

@media (max-width: 991.98px) {
    .cq-subjects-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .cq-subjects-tools {
        align-items: stretch;
        flex-direction: column;
    }
    .cq-subjects-search-wrap {
        flex-basis: auto;
        width: 100%;
    }
}

@media (max-width: 767.98px) {
    .cq-subjects-hero {
        min-height: 112px;
    }
    .cq-subjects-hero .hero-bubble {
        opacity: .5;
    }
    .cq-subjects-breadcrumb-content {
        padding-top: 78px;
    }
    .cq-subjects-breadcrumb-content .breadcrumb {
        margin-bottom: .5rem;
        padding: .45rem 1rem !important;
        font-size: .82rem;
    }
    .cq-subjects-content {
        padding-top: 1rem;
    }
    .cq-subjects-heading {
        align-items: stretch;
        flex-direction: column;
        gap: .65rem;
        margin-bottom: .75rem;
    }
    .cq-subjects-heading-search,
    .cq-subjects-search-wrap {
        width: 100%;
        max-width: none;
    }
    .cq-subjects-heading h1 {
        font-size: 1.2rem;
    }
    .cq-subjects-tools {
        position: sticky;
        z-index: 20;
        top: 68px;
        gap: .6rem;
        margin-right: -.25rem;
        margin-bottom: .75rem;
        margin-left: -.25rem;
        padding: .65rem;
    }
    .cq-subjects-initials {
        display: none;
    }
    .cq-subjects-initial-select {
        display: block;
        min-height: 42px;
    }
    .cq-subjects-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: .6rem;
    }
    .cq-subject-card {
        grid-template-columns: 78px minmax(0, 1fr) 18px;
        min-height: 84px;
        border-radius: .5rem;
    }
    .cq-subject-card:hover {
        transform: none;
    }
    .cq-subject-card-image-wrap {
        min-height: 82px;
    }
    .cq-subject-card-name {
        padding: .65rem .75rem;
        font-size: .94rem;
    }
    .cq-subject-card-arrow {
        margin-right: .7rem;
    }
}
