:root {
    color-scheme: light;
    --zavier-bg: #f3f7f8;
    --zavier-surface: #fffefa;
    --zavier-surface-soft: #f6f9f9;
    --zavier-border: #d7e3e6;
    --zavier-border-strong: #bdcdd2;
    --zavier-text: #14213d;
    --zavier-muted: #64758a;
    --zavier-primary: #1959c7;
    --zavier-primary-hover: #12469f;
    --zavier-primary-soft: #eaf1ff;
    --zavier-accent: #087f7a;
    --zavier-accent-soft: #e5f5f3;
    --zavier-success: #138a67;
    --zavier-rail-width: 0px;
    --zavier-topbar-height: 0px;
    --zavier-radius: 10px;
    --zavier-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

html:has(body[data-theme="zavier"]) { background: var(--zavier-bg); }

body.midnight-app {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    color: var(--zavier-text);
    background: var(--zavier-bg);
    font-family: Inter, system-ui, sans-serif;
}

.midnight-app h1,
.midnight-app h2,
.midnight-app h3,
.midnight-app h4,
.midnight-app .midnight-brand-copy strong,
.midnight-app .midnight-page-context strong {
    font-family: Manrope, Inter, system-ui, sans-serif;
}

.midnight-skip-link {
    position: fixed;
    z-index: 1100;
    top: .75rem;
    left: .75rem;
    padding: .65rem .9rem;
    color: #fff;
    border-radius: 10px;
    background: var(--zavier-primary);
    transform: translateY(-180%);
}

.midnight-skip-link:focus { transform: translateY(0); }

.midnight-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.midnight-rail {
    position: sticky;
    z-index: 1000;
    top: 0;
    margin: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    height: 76px;
    padding: 0 2rem;
    border: none;
    border-bottom: 1px solid var(--zavier-border);
    border-radius: 0;
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.midnight-brand {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: .8rem;
    padding: 0 2rem 0 0;
    color: var(--zavier-text);
    text-decoration: none;
}

.midnight-brand:hover { color: var(--zavier-text); }

.midnight-brand-mark {
    display: grid;
    width: 2.4rem;
    height: 2.4rem;
    flex: 0 0 2.4rem;
    overflow: hidden;
    place-items: center;
    color: #fff;
    border-radius: 10px;
    background: var(--zavier-primary);
}

.midnight-brand-mark img {
    width: 100%;
    height: 100%;
    padding: .3rem;
    object-fit: contain;
    background: #fff;
}

.midnight-brand-mark svg { width: 1.45rem; height: 1.45rem; }

.midnight-brand-copy {
    display: grid;
    min-width: 0;
    gap: .15rem;
}

.midnight-brand-copy strong {
    overflow: hidden;
    color: var(--zavier-text);
    font-size: .88rem;
    font-weight: 800;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.midnight-brand-copy small {
    color: var(--zavier-primary);
    font-size: .62rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.midnight-menu {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
}

.midnight-menu-label { display: none; }

.midnight-menu-item {
    position: relative;
    display: flex;
    min-height: 2.5rem;
    align-items: center;
    gap: .5rem;
    padding: .5rem .75rem;
    color: #64748b;
    border: none;
    border-radius: 10px;
    font-size: .85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all .2s ease;
}

.midnight-menu-item svg { display: none; }

.midnight-menu-item:hover {
    color: var(--zavier-primary);
    background: transparent;
    transform: translateY(-2px);
}

.midnight-menu-item.is-active {
    color: var(--zavier-primary);
    background: transparent;
    box-shadow: none;
    font-weight: 700;
}

.midnight-menu-item.is-active::after {
    position: absolute;
    bottom: -4px;
    left: 50%;
    width: 20px;
    height: 3px;
    border-radius: 999px;
    background: var(--zavier-primary);
    content: "";
    transform: translateX(-50%);
}

.midnight-rail-footer {
    display: flex;
    flex-direction: row;
    align-items: center;
    margin-left: auto;
    margin-top: 0;
    gap: 1rem;
    padding-top: 0;
}

.midnight-library-status,
.midnight-account {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: .65rem;
    padding: .5rem 1rem;
    color: var(--zavier-muted);
    border: none;
    border-radius: 999px;
    background: #f1f5f9;
    font-size: .75rem;
    font-weight: 600;
}

.midnight-library-status { display: none; }

.midnight-library-status > span:last-child { display: grid; min-width: 0; }
.midnight-library-status strong { color: var(--zavier-text); }

.midnight-library-status small {
    overflow: hidden;
    color: #8a98aa;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.midnight-status-dot {
    width: .5rem;
    height: .5rem;
    flex: 0 0 .5rem;
    border-radius: 50%;
    background: var(--zavier-success);
    box-shadow: 0 0 0 4px rgba(15, 159, 110, .1);
}

.midnight-account { color: var(--zavier-text); text-decoration: none; transition: all 0.2s; }
.midnight-account:hover { color: var(--zavier-primary); background: #e2e8f0; transform: translateY(-1px); }
.midnight-account svg { width: 1rem; height: 1rem; }

.midnight-workspace {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
}

.midnight-topbar {
    display: none;
}

.midnight-menu-toggle {
    display: none;
    width: 2.5rem;
    height: 2.5rem;
    place-items: center;
    color: var(--zavier-text);
    border: 1px solid var(--zavier-border);
    border-radius: 10px;
    background: #fff;
}

.midnight-menu-toggle svg { width: 1.15rem; height: 1.15rem; }

.midnight-page-context { display: grid; min-width: 0; gap: .1rem; }

.midnight-page-context span {
    color: var(--zavier-primary);
    font-size: .58rem;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.midnight-page-context strong {
    overflow: hidden;
    color: var(--zavier-text);
    font-size: .9rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.midnight-quick-actions { display: flex; margin-left: auto; gap: .5rem; }

.midnight-quick-actions a {
    display: grid;
    width: 2.45rem;
    height: 2.45rem;
    place-items: center;
    color: #64748b;
    border: 1px solid var(--zavier-border);
    border-radius: 10px;
    background: #fff;
}

.midnight-quick-actions a:hover {
    color: #fff !important;
    border-color: var(--zavier-primary);
    background: var(--zavier-primary);
}

.midnight-quick-actions svg { width: 1rem; height: 1rem; }
.midnight-content { min-width: 0; flex: 1; outline: 0; }

.midnight-content > .home-page,
.midnight-content > .opac-catalog-page,
.midnight-content > .catalog-browse-page,
.midnight-content > .catalog-detail-page,
.midnight-content > .catalog-statistics-page,
.midnight-content > .member-statistics-page,
.midnight-content > .visitor-statistics-page,
.midnight-content > .member-registration-page,
.midnight-content > .news-list-page,
.midnight-content > .news-detail-page,
.midnight-content > .survey-list-page,
.midnight-content > .survey-detail-page,
.midnight-content > .guest-location-page,
.midnight-content > .self-service-page,
body[data-theme="zavier"] .gt-page-container {
    min-height: auto;
    padding: 2rem !important;
    background: transparent !important;
}

.midnight-content .home-shell,
.midnight-content .opac-catalog-shell,
.midnight-content .catalog-browse-shell,
.midnight-content .catalog-detail-shell,
.midnight-content .catalog-statistics-shell,
.midnight-content .member-statistics-shell,
.midnight-content .visitor-statistics-shell,
.midnight-content .registration-shell,
.midnight-content .news-list-shell,
.midnight-content .news-detail-shell,
.midnight-content .survey-list-shell,
.midnight-content .survey-detail-shell,
.midnight-content .guest-location-shell,
.midnight-content .self-service-shell,
.midnight-content .gt-content-wrapper { max-width: 1380px; }

.midnight-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.15rem 2rem 1.35rem;
    color: #7b899b;
    border-top: 1px solid var(--zavier-border);
    background: #fff;
    font-size: .68rem;
}

.midnight-footer > div { display: grid; gap: .15rem; }
.midnight-footer strong { color: #536177; font-size: .72rem; }

.midnight-footer .footer-modifier-credit {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    color: #7b899b;
    text-decoration: none;
}

.midnight-footer .footer-modifier-credit:hover { color: var(--zavier-primary); }
.midnight-footer svg { width: .9rem; height: .9rem; }
.midnight-mobile-nav, .midnight-rail-scrim { display: none; }

/* Map page-specific Finexy tokens to the clean Zavier palette. */
body[data-theme="zavier"] .home-page,
body[data-theme="zavier"] .member-registration-page,
body[data-theme="zavier"] .opac-catalog-page,
body[data-theme="zavier"] .catalog-browse-page,
body[data-theme="zavier"] .catalog-detail-page,
body[data-theme="zavier"] .catalog-statistics-page,
body[data-theme="zavier"] .member-statistics-page,
body[data-theme="zavier"] .visitor-statistics-page,
body[data-theme="zavier"] .news-list-page,
body[data-theme="zavier"] .news-detail-page,
body[data-theme="zavier"] .survey-list-page,
body[data-theme="zavier"] .survey-detail-page,
body[data-theme="zavier"] .guest-location-page,
body[data-theme="zavier"] .self-service-page,
body[data-theme="zavier"] .gt-page-container {
    --home-blue: var(--zavier-primary);
    --home-blue-dark: var(--zavier-primary-hover);
    --home-blue-soft: var(--zavier-primary-soft);
    --home-border: var(--zavier-border);
    --home-text: var(--zavier-text);
    --home-muted: var(--zavier-muted);
    --opac-blue: var(--zavier-primary);
    --opac-blue-dark: var(--zavier-primary-hover);
    --opac-blue-soft: var(--zavier-primary-soft);
    --opac-border: var(--zavier-border);
    --opac-text: var(--zavier-text);
    --opac-muted: var(--zavier-muted);
    --browse-blue: var(--zavier-primary);
    --browse-blue-dark: var(--zavier-primary-hover);
    --browse-blue-soft: var(--zavier-primary-soft);
    --browse-border: var(--zavier-border);
    --browse-text: var(--zavier-text);
    --browse-muted: var(--zavier-muted);
    --detail-blue: var(--zavier-primary);
    --detail-blue-dark: var(--zavier-primary-hover);
    --detail-blue-soft: var(--zavier-primary-soft);
    --detail-border: var(--zavier-border);
    --detail-text: var(--zavier-text);
    --detail-muted: var(--zavier-muted);
    --statistics-blue: var(--zavier-primary);
    --statistics-blue-dark: var(--zavier-primary-hover);
    --statistics-blue-soft: var(--zavier-primary-soft);
    --statistics-border: var(--zavier-border);
    --statistics-text: var(--zavier-text);
    --statistics-muted: var(--zavier-muted);
    --member-blue: var(--zavier-primary);
    --member-blue-dark: var(--zavier-primary-hover);
    --member-blue-soft: var(--zavier-primary-soft);
    --member-border: var(--zavier-border);
    --member-text: var(--zavier-text);
    --member-muted: var(--zavier-muted);
    --news-blue: var(--zavier-primary);
    --news-blue-dark: var(--zavier-primary-hover);
    --news-blue-soft: var(--zavier-primary-soft);
    --news-blue-pale: #f8fafc;
    --news-border: var(--zavier-border);
    --news-text: var(--zavier-text);
    --news-muted: var(--zavier-muted);
    --survey-blue: var(--zavier-primary);
    --survey-blue-dark: var(--zavier-primary-hover);
    --survey-blue-soft: var(--zavier-primary-soft);
    --survey-blue-pale: #f8fafc;
    --survey-border: var(--zavier-border);
    --survey-text: var(--zavier-text);
    --survey-muted: var(--zavier-muted);
    --self-blue: var(--zavier-primary);
    --self-blue-dark: var(--zavier-primary-hover);
    --self-blue-soft: var(--zavier-primary-soft);
    --self-border: var(--zavier-border);
    --self-text: var(--zavier-text);
    --self-muted: var(--zavier-muted);
    color: var(--zavier-text) !important;
}

body[data-theme="zavier"] main h1,
body[data-theme="zavier"] main h2,
body[data-theme="zavier"] main h3,
body[data-theme="zavier"] main h4,
body[data-theme="zavier"] main h5,
body[data-theme="zavier"] main h6 { color: var(--zavier-text) !important; }

body[data-theme="zavier"] main p,
body[data-theme="zavier"] main small,
body[data-theme="zavier"] main .text-muted,
body[data-theme="zavier"] main [class*="subtitle"],
body[data-theme="zavier"] main [class*="description"] { color: var(--zavier-muted) !important; }

body[data-theme="zavier"] main .card,
body[data-theme="zavier"] main .search-container,
body[data-theme="zavier"] main .search-box,
body[data-theme="zavier"] main .content-section,
body[data-theme="zavier"] main .form-section,
body[data-theme="zavier"] main .result-section,
body[data-theme="zavier"] .home-section,
body[data-theme="zavier"] .opac-search-panel,
body[data-theme="zavier"] .opac-sidebar-panel,
body[data-theme="zavier"] .opac-results,
body[data-theme="zavier"] .news-list-panel,
body[data-theme="zavier"] .survey-panel,
body[data-theme="zavier"] .self-service-panel,
body[data-theme="zavier"] .gt-card,
body[data-theme="zavier"] .gt-header-card {
    color: var(--zavier-text) !important;
    border: none !important;
    border-radius: var(--zavier-radius) !important;
    background-color: var(--zavier-surface) !important;
    box-shadow: var(--zavier-shadow) !important;
}

body[data-theme="zavier"] main input,
body[data-theme="zavier"] main select,
body[data-theme="zavier"] main textarea,
body[data-theme="zavier"] main .form-control,
body[data-theme="zavier"] main .form-select {
    color: var(--zavier-text) !important;
    border-color: var(--zavier-border-strong) !important;
    background-color: #fff !important;
}

body[data-theme="zavier"] main input::placeholder,
body[data-theme="zavier"] main textarea::placeholder { color: #96a3b5 !important; }

body[data-theme="zavier"] main table,
body[data-theme="zavier"] main th,
body[data-theme="zavier"] main td {
    color: var(--zavier-text) !important;
    border-color: var(--zavier-border) !important;
    background-color: #fff !important;
}

body[data-theme="zavier"] main .btn-primary,
body[data-theme="zavier"] main .btn-brand {
    color: #fff !important;
    border-color: var(--zavier-primary) !important;
    background: var(--zavier-primary) !important;
}

body[data-theme="zavier"] main .btn-primary:hover,
body[data-theme="zavier"] main .btn-brand:hover { background: var(--zavier-primary-hover) !important; }

/* Zavier's compact bento home replaces the original icon catalogue. */
body[data-theme="zavier"] .home-banner-slide,
body[data-theme="zavier"] .home-welcome-banner {
    height: 400px;
    border-color: var(--zavier-border);
    border-radius: var(--zavier-radius);
}

body[data-theme="zavier"] .home-banner-copy {
    inset: auto auto 1.5rem 1.5rem;
    max-width: 620px;
    padding: 1.25rem 1.35rem;
    border-radius: 10px;
    background: rgba(23, 32, 51, .86);
    backdrop-filter: blur(12px);
}

body[data-theme="zavier"] .home-banner-copy p,
body[data-theme="zavier"] .home-banner-copy span { color: #e2e8f0 !important; }
body[data-theme="zavier"] .home-banner-dots { justify-content: flex-start; }

body[data-theme="zavier"] .home-search-panel {
    grid-template-columns: minmax(190px, .55fr) minmax(0, 1.45fr);
    padding: 1.15rem;
    border-color: var(--zavier-border);
    border-radius: var(--zavier-radius);
    background: #fff !important;
}

body[data-theme="zavier"] .home-shortcut-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .75rem;
    padding: 1rem;
}

body[data-theme="zavier"] .home-shortcut-list > a {
    min-height: 96px;
    padding: .9rem;
    flex-direction: row;
    justify-content: flex-start;
    gap: .8rem;
    color: var(--zavier-text);
    border-color: var(--zavier-border);
    border-radius: 10px;
    background: #fafbfd;
    text-align: left;
}

body[data-theme="zavier"] .home-shortcut-list > a:hover {
    border-color: #b9cef5;
    background: var(--zavier-primary-soft);
}

body[data-theme="zavier"] .home-shortcut-list > a > span {
    width: 2.65rem;
    height: 2.65rem;
    flex: 0 0 2.65rem;
    margin: 0;
    color: var(--zavier-primary);
    border-radius: 10px;
    background: var(--zavier-primary-soft);
}

body[data-theme="zavier"] .home-shortcut-list strong,
body[data-theme="zavier"] .home-stat-card strong { color: var(--zavier-text); }

body[data-theme="zavier"] .home-stat-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .85rem;
    padding: 1.1rem;
    overflow: visible;
    background: transparent;
}

body[data-theme="zavier"] .home-stat-card {
    min-height: 116px;
    align-items: center;
    gap: .85rem;
    padding: 1rem;
    border: 1px solid var(--zavier-border) !important;
    border-radius: 10px !important;
    background: #f9fbfd !important;
    box-shadow: none !important;
}

body[data-theme="zavier"] .home-stat-card > span {
    width: 2.75rem;
    height: 2.75rem;
    flex-basis: 2.75rem;
    border-radius: 10px;
    background: var(--zavier-primary-soft);
}

body[data-theme="zavier"] .home-stat-card small {
    margin-bottom: .1rem;
    color: #62738a !important;
    font-size: .7rem;
    line-height: 1.3;
}

body[data-theme="zavier"] .home-stat-card strong {
    font-size: 1.55rem;
    line-height: 1.12;
}

body[data-theme="zavier"] .home-stat-card em {
    margin-top: .3rem;
    color: #8795a8;
    font-size: .64rem;
}

body[data-theme="zavier"] .opac-page-header,
body[data-theme="zavier"] .browse-page-header,
body[data-theme="zavier"] .catalog-detail-header,
body[data-theme="zavier"] .statistics-page-header,
body[data-theme="zavier"] .member-statistics-header,
body[data-theme="zavier"] .news-list-header,
body[data-theme="zavier"] .survey-page-header,
body[data-theme="zavier"] .self-service-header,
body[data-theme="zavier"] .guest-location-header,
body[data-theme="zavier"] .registration-page-header {
    border: 1px solid var(--zavier-border) !important;
    border-radius: 10px !important;
    background: transparent !important;
    box-shadow: none !important;
}

body[data-theme="zavier"] .opac-quick-menu { grid-template-columns: repeat(2, minmax(0, 1fr)); }

body[data-theme="zavier"] .opac-quick-menu > a {
    min-height: 76px;
    color: var(--zavier-text);
    border-color: var(--zavier-border);
    border-radius: 10px;
    background: #fff;
}

body[data-theme="zavier"] .opac-book-cover,
body[data-theme="zavier"] .home-book-cover,
body[data-theme="zavier"] .news-list-card-cover {
    border-color: var(--zavier-border);
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(31, 50, 78, .09);
}

body[data-theme="zavier"] .opac-statistics-nav {
    padding: .4rem;
    border: 1px solid var(--zavier-border);
    border-radius: 10px;
    background: #fff;
}

body[data-theme="zavier"] .opac-statistics-nav a {
    border: 0;
    border-radius: 10px;
    background: transparent;
}

body[data-theme="zavier"] .opac-statistics-nav a.active {
    color: #fff !important;
    background: var(--zavier-primary);
}

@media (max-width: 991.98px) {
    .midnight-shell { display: block; }

    .midnight-rail {
        position: fixed;
        z-index: 1001;
        top: 0;
        left: 0;
        width: min(84vw, 300px);
        height: 100%;
        flex-direction: column;
        align-items: stretch;
        padding: 2rem 1.5rem;
        box-shadow: 18px 0 42px rgba(31, 50, 78, .14);
        transform: translateX(-105%);
        transition: transform .2s ease;
        overflow-y: auto;
    }

    .midnight-menu {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        margin-top: 2rem;
    }

    .midnight-menu-open .midnight-rail { transform: translateX(0); }

    .midnight-rail-scrim {
        position: fixed;
        z-index: 1000;
        inset: 0;
        width: 100%;
        height: 100%;
        padding: 0;
        border: 0;
        background: rgba(23, 32, 51, .3);
        backdrop-filter: blur(2px);
    }

    .midnight-menu-open .midnight-rail-scrim { display: block; }
    .midnight-menu-toggle { display: grid; }
    .midnight-topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 64px; padding: 0 1rem; }

    .midnight-content > .home-page,
    .midnight-content > .opac-catalog-page,
    .midnight-content > .catalog-browse-page,
    .midnight-content > .catalog-detail-page,
    .midnight-content > .catalog-statistics-page,
    .midnight-content > .member-statistics-page,
    .midnight-content > .visitor-statistics-page,
    .midnight-content > .member-registration-page,
    .midnight-content > .news-list-page,
    .midnight-content > .news-detail-page,
    .midnight-content > .survey-list-page,
    .midnight-content > .survey-detail-page,
    .midnight-content > .guest-location-page,
    .midnight-content > .self-service-page,
    body[data-theme="zavier"] .gt-page-container { padding: 1.1rem 1rem 6.5rem !important; }

    .midnight-footer {
        margin-bottom: 4.75rem;
        padding: 1rem;
        align-items: flex-start;
        flex-direction: column;
    }

    .midnight-mobile-nav {
        position: fixed;
        z-index: 900;
        right: 0;
        bottom: 0;
        left: 0;
        display: flex;
        overflow-x: auto;
        min-height: 4.25rem;
        padding: .4rem;
        border: 0;
        border-top: 1px solid var(--zavier-border);
        border-radius: 0;
        background: rgba(255, 255, 255, .96);
        box-shadow: 0 -4px 24px rgba(0, 0, 0, .08);
        backdrop-filter: blur(18px);
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
    }
    .midnight-mobile-nav::-webkit-scrollbar {
        display: none;
    }

    .midnight-mobile-nav a {
        display: flex;
        flex: 0 0 22%;
        min-width: 72px;
        align-items: center;
        justify-content: center;
        gap: .2rem;
        padding: .4rem .2rem;
        flex-direction: column;
        color: #7a899c;
        border-radius: 10px;
        font-size: .56rem;
        font-weight: 650;
        text-decoration: none;
        scroll-snap-align: center;
    }

    .midnight-mobile-nav a.is-active {
        color: var(--zavier-primary);
        background: var(--zavier-primary-soft);
    }

    .midnight-mobile-nav svg { width: 1.12rem; height: 1.12rem; }

    body[data-theme="zavier"] .home-banner-track {
        gap: .75rem;
        padding: 0;
        overscroll-behavior-inline: contain;
        scroll-padding-inline: 0;
    }

    body[data-theme="zavier"] .home-banner-slide {
        height: clamp(230px, 32vw, 290px);
        flex-basis: 100%;
        border-radius: 10px;
        scroll-snap-align: start;
        scroll-snap-stop: always;
    }

    body[data-theme="zavier"] .home-welcome-banner {
        min-height: 230px;
        height: auto;
    }

    body[data-theme="zavier"] .home-banner-slide > img {
        display: block;
        object-position: center;
    }

    body[data-theme="zavier"] .home-banner-dots {
        min-height: 2rem;
        justify-content: center;
        padding-top: .65rem;
    }

    body[data-theme="zavier"] .home-shortcut-list {
        display: flex;
        overflow-x: auto;
        scroll-padding-inline: 1rem;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
    }

    body[data-theme="zavier"] .home-shortcut-list::-webkit-scrollbar { display: none; }
    body[data-theme="zavier"] .home-shortcut-list > a { flex: 0 0 min(78vw, 290px); scroll-snap-align: start; }

    body[data-theme="zavier"] .home-stat-list {
        display: flex;
        gap: .75rem;
        padding: .85rem 1rem 1rem;
        overflow-x: auto;
        border: 0;
        border-radius: 0;
        background: transparent;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
    }

    body[data-theme="zavier"] .home-stat-card {
        flex: 0 0 min(70vw, 250px);
        scroll-snap-align: start;
    }
}

/* Zavier coverage for legacy public reports and Baca di Tempat. */
body[data-theme="zavier"] .midnight-content > .container {
    width: min(100% - 32px, 1380px);
    max-width: 1380px;
    margin-right: auto;
    margin-left: auto;
}

body[data-theme="zavier"] .ros-header-card {
    position: relative;
    overflow: hidden;
    border-color: var(--zavier-border);
    border-radius: 10px 6px 10px 10px;
    background: var(--zavier-surface);
    box-shadow: 0 10px 28px rgb(20 33 61 / 6%);
}

body[data-theme="zavier"] .ros-header-card::before {
    position: absolute;
    top: 20%;
    bottom: 20%;
    left: 0;
    width: 4px;
    border-radius: 999px;
    background: var(--zavier-accent);
    content: "";
}

body[data-theme="zavier"] .ros-header-icon {
    border-radius: 10px 5px 10px 10px;
    background: var(--zavier-primary-soft);
    color: var(--zavier-primary);
}

body[data-theme="zavier"] .ros-btn-change-room {
    border-color: rgb(8 127 122 / 24%);
    background: var(--zavier-accent-soft);
    color: var(--zavier-accent);
}

body[data-theme="zavier"] .ros-btn-change-room:hover {
    border-color: var(--zavier-accent);
    background: var(--zavier-accent);
    color: #fff;
}

body[data-theme="zavier"] .ros-stat-box {
    border-color: var(--zavier-border);
    border-radius: 10px 5px 10px 10px;
    background: linear-gradient(135deg, #f4f8ff, #eef9f7);
}

body[data-theme="zavier"] .ros-stat-icon {
    border-radius: 10px 4px 10px 10px;
    background: var(--zavier-accent);
    box-shadow: 0 5px 13px rgb(8 127 122 / 20%);
}

body[data-theme="zavier"] .ros-stat-number,
body[data-theme="zavier"] .ros-breadcrumb-active { color: var(--zavier-text); }

body[data-theme="zavier"] .ros-breadcrumb a { color: var(--zavier-primary); }

body[data-theme="zavier"] .midnight-content > .container > .row .breadcrumb {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 10px 14px;
    border: 1px solid var(--zavier-border);
    border-radius: 10px 4px 10px 10px;
    background: var(--zavier-surface);
}

body[data-theme="zavier"] .midnight-content > .container > .card,
body[data-theme="zavier"] .midnight-content > .container > .row .custom-search-card {
    border-radius: 10px 6px 10px 10px !important;
}

@media (max-width: 767.98px) {
    body[data-theme="zavier"] .midnight-content > .container {
        width: min(100% - 24px, 1380px);
        padding-right: 0;
        padding-left: 0;
    }

    body[data-theme="zavier"] .main-container,
    body[data-theme="zavier"] .midnight-content > .container.py-5 {
        margin-top: 76px !important;
        padding-top: 20px !important;
        padding-bottom: 92px !important;
    }

    body[data-theme="zavier"] .ros-header-card {
        padding: 18px 16px;
    }

    body[data-theme="zavier"] .ros-header-info {
        width: 100%;
        align-items: flex-start;
    }

    body[data-theme="zavier"] .ros-room-title-row { gap: 8px; }
    body[data-theme="zavier"] .ros-room-title { font-size: 1.2rem; }
}

@media (max-width: 767.98px) {
    body[data-theme="zavier"] .home-hero { margin-bottom: .75rem; }

    body[data-theme="zavier"] .home-banner-slide {
        height: clamp(180px, 48vw, 230px);
        border-radius: 10px;
    }

    body[data-theme="zavier"] .home-banner-copy {
        inset: auto .65rem .65rem;
        width: auto;
        max-width: none;
        padding: .7rem .8rem;
        border-radius: 10px;
    }

    body[data-theme="zavier"] .home-banner-copy > span {
        margin-bottom: .15rem;
        font-size: .56rem;
    }

    body[data-theme="zavier"] .home-banner-copy h1 {
        font-size: clamp(.9rem, 4vw, 1.08rem);
        line-height: 1.25;
    }

    body[data-theme="zavier"] .home-banner-copy p {
        margin-top: .2rem;
        font-size: .64rem;
        line-height: 1.4;
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }

    body[data-theme="zavier"] .home-banner-dots button {
        width: .45rem;
        height: .45rem;
    }

    body[data-theme="zavier"] .home-banner-dots button.is-active { width: 1.5rem; }

    body[data-theme="zavier"] .home-welcome-banner {
        min-height: 180px;
        padding: 1.25rem;
    }
}

@media (max-width: 575.98px) {
    .midnight-page-context strong { max-width: 48vw; }
    .midnight-quick-actions a:last-child { display: none; }
    body[data-theme="zavier"] .home-search-panel { grid-template-columns: 1fr; }

    body[data-theme="zavier"] .opac-quick-menu {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
    }

    body[data-theme="zavier"] .opac-quick-menu > a { flex: 0 0 78%; scroll-snap-align: start; }
}

@media (max-width: 399.98px) {
    body[data-theme="zavier"] .home-banner-slide { height: 176px; }
    body[data-theme="zavier"] .home-banner-copy p { -webkit-line-clamp: 1; line-clamp: 1; }
}

@media (prefers-reduced-motion: reduce) {
    body[data-theme="zavier"] *,
    body[data-theme="zavier"] *::before,
    body[data-theme="zavier"] *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}

/* Zavier signature: catalogue blue, reading-room teal, and warm paper. */
body[data-theme="zavier"].midnight-app {
    background: linear-gradient(90deg, rgb(20 33 61 / 2%) 1px, transparent 1px) 0 0 / 72px 72px, var(--zavier-bg);
}

body[data-theme="zavier"] .midnight-rail {
    border-right-color: #ccdade;
    background: rgb(255 254 250 / 97%);
    box-shadow: 10px 0 32px rgb(20 33 61 / 4%);
}

@media (max-width: 991.98px) {
    body[data-theme="zavier"] .midnight-rail {
        position: sticky;
        transform: none;
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        height: auto;
        padding: 0 1.25rem;
        box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    }
    body[data-theme="zavier"] .midnight-brand {
        order: 1;
        padding: 16px 0 8px;
    }
    body[data-theme="zavier"] .midnight-rail-footer {
        order: 2;
        padding: 16px 0 8px;
        margin-left: auto;
    }
    body[data-theme="zavier"] .midnight-menu {
        order: 3;
        flex-direction: row;
        width: 100%;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 8px;
        margin-top: 0;
        scrollbar-width: none;
    }
    body[data-theme="zavier"] .midnight-menu::-webkit-scrollbar {
        display: none;
    }
    body[data-theme="zavier"] .midnight-menu-item {
        flex: 0 0 auto;
    }

    body[data-theme="zavier"] .midnight-topbar,
    body[data-theme="zavier"] .midnight-mobile-nav {
        display: none !important;
    }
    body[data-theme="zavier"] .midnight-footer {
        margin-bottom: 0;
        align-items: center;
        text-align: center;
    }
    body[data-theme="zavier"] .midnight-content > div[class$="-page"],
    body[data-theme="zavier"] .midnight-content > main[class$="-page"],
    body[data-theme="zavier"] .gt-page-container {
        padding-bottom: 2rem !important;
    }
}

body[data-theme="zavier"] .midnight-rail::before {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--zavier-primary) 0 68%, var(--zavier-accent) 68%);
    content: "";
}

body[data-theme="zavier"] .midnight-brand-mark {
    position: relative;
    border-radius: 10px 5px 10px 10px;
    background: var(--zavier-text);
    box-shadow: 0 7px 18px rgb(20 33 61 / 16%);
}

body[data-theme="zavier"] .midnight-brand-mark::after {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 14px;
    height: 5px;
    background: var(--zavier-accent);
    content: "";
}

body[data-theme="zavier"] .midnight-menu-item { border-radius: 10px 5px 10px 10px; }

body[data-theme="zavier"] .midnight-menu-item.is-active {
    border-color: #c8d9f6;
    background: linear-gradient(90deg, var(--zavier-primary-soft), #f4fbfa);
    color: var(--zavier-primary-hover);
}

body[data-theme="zavier"] .midnight-menu-item.is-active::before {
    left: -1px;
    width: 4px;
    height: 22px;
    background: var(--zavier-accent);
}

body[data-theme="zavier"] .midnight-library-status {
    border-left: 3px solid var(--zavier-accent);
    background: #f7fbfa;
}

body[data-theme="zavier"] .midnight-topbar {
    border-bottom-color: #d5e1e4;
    background: rgb(255 254 250 / 91%);
}

body[data-theme="zavier"] .midnight-topbar::after {
    position: absolute;
    right: 2rem;
    bottom: -1px;
    width: 58px;
    height: 2px;
    background: var(--zavier-accent);
    content: "";
}

body[data-theme="zavier"] .midnight-page-context span { color: var(--zavier-accent); }
body[data-theme="zavier"] .midnight-quick-actions a { border-radius: 10px 5px 10px 10px; background: var(--zavier-surface); }
body[data-theme="zavier"] .midnight-quick-actions a:hover { border-color: var(--zavier-text); background: var(--zavier-text); }

body[data-theme="zavier"] main .card,
body[data-theme="zavier"] main .search-container,
body[data-theme="zavier"] main .search-box,
body[data-theme="zavier"] main .content-section,
body[data-theme="zavier"] main .form-section,
body[data-theme="zavier"] main .result-section,
body[data-theme="zavier"] .home-section,
body[data-theme="zavier"] .opac-search-panel,
body[data-theme="zavier"] .opac-sidebar-panel,
body[data-theme="zavier"] .opac-results,
body[data-theme="zavier"] .news-list-panel,
body[data-theme="zavier"] .survey-panel,
body[data-theme="zavier"] .self-service-panel,
body[data-theme="zavier"] .gt-card,
body[data-theme="zavier"] .gt-header-card {
    border-color: var(--zavier-border) !important;
    border-radius: 10px 6px 10px 10px !important;
    background-color: var(--zavier-surface) !important;
    box-shadow: 0 10px 28px rgb(20 33 61 / 6%) !important;
}

body[data-theme="zavier"] .opac-page-header,
body[data-theme="zavier"] .browse-page-header,
body[data-theme="zavier"] .catalog-detail-header,
body[data-theme="zavier"] .statistics-page-header,
body[data-theme="zavier"] .member-statistics-header,
body[data-theme="zavier"] .visitor-statistics-header,
body[data-theme="zavier"] .news-list-header,
body[data-theme="zavier"] .news-detail-header,
body[data-theme="zavier"] .survey-page-header,
body[data-theme="zavier"] .survey-detail-header,
body[data-theme="zavier"] .self-service-header,
body[data-theme="zavier"] .guest-location-header,
body[data-theme="zavier"] .registration-page-header {
    position: relative;
    padding-left: 1.15rem !important;
}

body[data-theme="zavier"] .opac-page-header::before,
body[data-theme="zavier"] .browse-page-header::before,
body[data-theme="zavier"] .catalog-detail-header::before,
body[data-theme="zavier"] .statistics-page-header::before,
body[data-theme="zavier"] .member-statistics-header::before,
body[data-theme="zavier"] .visitor-statistics-header::before,
body[data-theme="zavier"] .news-list-header::before,
body[data-theme="zavier"] .news-detail-header::before,
body[data-theme="zavier"] .survey-page-header::before,
body[data-theme="zavier"] .survey-detail-header::before,
body[data-theme="zavier"] .self-service-header::before,
body[data-theme="zavier"] .guest-location-header::before,
body[data-theme="zavier"] .registration-page-header::before {
    position: absolute;
    top: 18%;
    bottom: 18%;
    left: 0;
    width: 4px;
    border-radius: 999px;
    background: var(--zavier-accent);
    content: "";
}

body[data-theme="zavier"] .home-section-header h2,
body[data-theme="zavier"] [class*="section-header"] h2 { position: relative; padding-left: 12px; }

body[data-theme="zavier"] .home-section-header h2::before,
body[data-theme="zavier"] [class*="section-header"] h2::before {
    position: absolute;
    top: .18em;
    bottom: .18em;
    left: 0;
    width: 3px;
    border-radius: 3px;
    background: var(--zavier-accent);
    content: "";
}

body[data-theme="zavier"] main .btn-primary,
body[data-theme="zavier"] main .btn-brand {
    border-color: var(--zavier-primary) !important;
    border-radius: 10px 4px 10px 10px !important;
    background: var(--zavier-primary) !important;
    box-shadow: 0 6px 14px rgb(25 89 199 / 16%);
}

body[data-theme="zavier"] main input:focus,
body[data-theme="zavier"] main select:focus,
body[data-theme="zavier"] main textarea:focus,
body[data-theme="zavier"] main .form-control:focus,
body[data-theme="zavier"] main .form-select:focus {
    border-color: var(--zavier-accent) !important;
    outline: 0;
    box-shadow: 0 0 0 4px rgb(15 159 152 / 12%) !important;
}

body[data-theme="zavier"] .home-shortcut-list > a:nth-child(3n + 2) > span,
body[data-theme="zavier"] .opac-quick-menu > a:nth-child(even) > span,
body[data-theme="zavier"] .home-stat-card:nth-child(even) > span {
    background: var(--zavier-accent-soft) !important;
    color: var(--zavier-accent) !important;
}

body[data-theme="zavier"] .home-stat-card,
body[data-theme="zavier"] .opac-quick-menu > a { position: relative; overflow: hidden; }

body[data-theme="zavier"] .home-stat-card::after,
body[data-theme="zavier"] .opac-quick-menu > a::after {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 34px;
    height: 3px;
    background: var(--zavier-accent);
    content: "";
}

body[data-theme="zavier"] .opac-book-cover,
body[data-theme="zavier"] .home-book-cover,
body[data-theme="zavier"] .news-list-card-cover {
    border-radius: 10px 4px 10px 10px;
    box-shadow: 7px 9px 0 #e3ecee, 0 8px 18px rgb(20 33 61 / 8%);
}

body[data-theme="zavier"] .midnight-footer { border-top-color: #d5e1e4; background: var(--zavier-surface); }
body[data-theme="zavier"] .footer-modifier-credit { padding-bottom: 3px; border-bottom: 2px solid var(--zavier-accent); }

@media (max-width: 991.98px) {
    body[data-theme="zavier"] .midnight-topbar::after { right: 1rem; }
    body[data-theme="zavier"] .midnight-mobile-nav {
        border-color: #cbdadd;
        border-radius: 10px 6px 10px 10px;
        background: rgb(255 254 250 / 96%);
    }
    body[data-theme="zavier"] .midnight-mobile-nav a.is-active {
        color: var(--zavier-primary);
        background: linear-gradient(180deg, var(--zavier-primary-soft), var(--zavier-accent-soft));
    }
}

/* ============================================================
   MOBILE: Global border-radius 10px untuk semua halaman
   ============================================================ */
@media (max-width: 991.98px) {
    body[data-theme="zavier"] .card,
    body[data-theme="zavier"] .card-header,
    body[data-theme="zavier"] .card-body,
    body[data-theme="zavier"] .card-footer,
    body[data-theme="zavier"] .modal-content,
    body[data-theme="zavier"] .modal-header,
    body[data-theme="zavier"] .modal-body,
    body[data-theme="zavier"] .modal-footer,
    body[data-theme="zavier"] .alert,
    body[data-theme="zavier"] .dropdown-menu,
    body[data-theme="zavier"] .popover,
    body[data-theme="zavier"] .toast,
    body[data-theme="zavier"] .tooltip-inner,
    body[data-theme="zavier"] .list-group,
    body[data-theme="zavier"] .list-group-item:first-child,
    body[data-theme="zavier"] .list-group-item:last-child,
    body[data-theme="zavier"] .breadcrumb,
    body[data-theme="zavier"] .pagination,
    body[data-theme="zavier"] .nav-tabs,
    body[data-theme="zavier"] .tab-content,
    body[data-theme="zavier"] .accordion-item,
    body[data-theme="zavier"] .input-group,
    body[data-theme="zavier"] .form-control,
    body[data-theme="zavier"] .form-select,
    body[data-theme="zavier"] .btn,
    body[data-theme="zavier"] .badge,
    body[data-theme="zavier"] .progress,
    body[data-theme="zavier"] .table-responsive,
    body[data-theme="zavier"] .dataTables_wrapper,
    body[data-theme="zavier"] table.dataTable {
        border-radius: 10px !important;
    }

    /* Page headers — override border-radius: 0 */
    body[data-theme="zavier"] .opac-catalog-header,
    body[data-theme="zavier"] .catalog-browse-header,
    body[data-theme="zavier"] .catalog-detail-header,
    body[data-theme="zavier"] .catalog-statistics-header,
    body[data-theme="zavier"] .visitor-statistics-header,
    body[data-theme="zavier"] .member-statistics-header,
    body[data-theme="zavier"] .news-list-header,
    body[data-theme="zavier"] .survey-page-header,
    body[data-theme="zavier"] .self-service-header,
    body[data-theme="zavier"] .guest-location-header,
    body[data-theme="zavier"] .registration-page-header {
        border-radius: 10px !important;
    }

    /* Stat list container — override border-radius: 0 */
    body[data-theme="zavier"] .home-stat-list {
        border-radius: 10px !important;
    }

    /* Image & media elements */
    body[data-theme="zavier"] img.rounded,
    body[data-theme="zavier"] .image-link img,
    body[data-theme="zavier"] .thumbnail,
    body[data-theme="zavier"] .img-thumbnail {
        border-radius: 10px !important;
    }
}
