:root {
    --color-black: #000000;
    --color-white: #ffffff;
    --color-grey: #9e9e9e;
    --color-card-bg: #ffffff;
    --color-primary: #43a64e;
    --color-primary-bg: #43a64e;
    --color-secondary-bg: #f4f4f4;
    --color-primary-text: #000000;

    /* Spacing */
    --gap-top: 20px;
    --gap-bottom: 60px;
    --horizontal-padding: 16px;
    --section-gap: 16px;
    --border-radius-sm: 4px;
    --border-radius-lg: 6px;

    /* Fixed navbar height — the single source of truth for anything that
       needs to sit flush below it (body offset, sticky sidebars). Change
       this if the navbar's own padding/content height ever changes. */
    --navbar-height: 76px;
}

* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

body {
    margin: 0;
    padding: 0;
    font-family: "Roboto", "Arial", sans-serif;
    color: var(--color-primary-text);
    background-color: var(--color-white);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-top: var(--navbar-height);
}

.page-padding {
    padding: var(--gap-top) var(--horizontal-padding) var(--gap-bottom) var(--horizontal-padding);
}

/* Typography */
.text-heading {
    color: var(--color-primary-text);
    font-weight: 700;
    font-size: 18px;
}

.text-secondary {
    color: var(--color-grey);
    font-weight: 500;
    font-size: 16px;
}

.text-footnote {
    color: var(--color-primary-text);
    font-weight: 400;
    font-size: 14px;
}

/* Components */
.card {
    background-color: rgba(244, 244, 244, 0.8);
    border-radius: var(--border-radius-lg);
    border: 1px solid rgba(0, 0, 0, 0.08);
    padding: var(--section-gap);
    margin-bottom: var(--section-gap);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    border-radius: var(--border-radius-sm);
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: opacity 0.2s;
    text-decoration: none;
    text-align: center;
    border: 1px solid transparent;
}

.btn:active {
    opacity: 0.8;
}

.btn-filled {
    background-color: var(--color-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
}

.btn-filled-disabled {
    background-color: rgba(67, 166, 78, 0.1);
    color: var(--color-primary);
    border-color: rgba(67, 166, 78, 0.1);
    cursor: not-allowed;
    pointer-events: none;
}

.btn-outlined {
    background-color: transparent;
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.btn-secondary {
    background-color: var(--color-white);
    color: var(--color-grey);
    border-color: var(--color-grey);
    font-weight: 500;
}

/* Forms */
.input-field {
    border-radius: var(--border-radius-sm);
    border: 1px solid rgba(0, 0, 0, 0.3);
    padding: 12px;
    font-size: 16px;
    width: 100%;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s;
}

.input-field:focus {
    border-color: rgba(0, 0, 0, 0.3);
}

/* ==========================================================================
   Sticky Header / Navbar
   White background, elevated (shadow), brand on the left,
   dropdown (with nested sub-dropdown) on the right.
   ========================================================================== */
.app-header {
    position: fixed;
    top: 0;
    z-index: 1000;
    height: var(--navbar-height);
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    width: 100%;
    box-sizing: border-box;
}

.navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    height: 100%;
    margin: 0 auto;
    padding: 0 var(--horizontal-padding);
    width: 100%;
    box-sizing: border-box;
    position: relative;
}

.navbar-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: opacity 0.2s;
}

.navbar-brand:hover {
    opacity: 0.9;
}

.navbar-brand-logo {
    height: 40px;
    width: 40px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.navbar-menu-panel {
    display: contents;
}

.navbar-menu-header {
    display: none;
}

.navbar-menu-vscroll {
    display: contents;
}

.navbar-menu-vscroll .vscroll-arrow {
    display: none;
}

.navbar-menu {
    display: flex;
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
}

.navbar-item {
    list-style: none;
    position: relative;
}

.navbar-link {
    color: var(--color-primary-text);
    font-weight: 500;
    font-size: 15px;
    padding: 8px 16px;
    border-radius: 4px;
    transition: all 0.18s ease-in-out;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.navbar-link--static {
    cursor: default;
}

.navbar-link:hover {
    background-color: rgba(67, 166, 78, 0.08);
    color: var(--color-primary);
}

.navbar-link.active {
    background-color: var(--color-primary);
    color: var(--color-white);
}

/* Mobile-only expand/collapse caret for top-level dropdown items — hidden
   on desktop, where hover already reveals the dropdown. */
.navbar-dropdown-caret {
    display: none;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--color-primary-text);
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
}

.navbar-dropdown-caret svg {
    transition: transform 0.18s ease;
}

.navbar-item.has-dropdown.is-open > .navbar-dropdown-caret svg,
.navbar-item.has-subdropdown.is-open > .navbar-dropdown-caret svg {
    transform: rotate(180deg);
}

/* Circular language-toggle avatar, sits to the right of the nav menu */
.lang-avatar-item {
    margin-left: 12px;
}

.lang-avatar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--color-secondary-bg);
    color: var(--color-primary);
    font-weight: 700;
    font-size: 13px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    cursor: pointer;
    font-family: inherit;
}

.lang-avatar-btn:hover {
    background-color: rgba(67, 166, 78, 0.1);
}

.navbar-dropdown .lang-option-link {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
}

.lang-option-avatar {
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-secondary-bg);
    color: var(--color-primary);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.lang-option-link.active .lang-option-avatar {
    background-color: var(--color-white);
    color: var(--color-primary);
    border-color: var(--color-white);
}

.lang-option-name {
    flex: 1;
    min-width: 0;
}

.navbar-item-avatar {
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-secondary-bg);
    color: var(--color-primary);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.navbar-link.active .navbar-item-avatar {
    background-color: var(--color-white);
    color: var(--color-primary);
    border-color: var(--color-white);
}

/* Dropdown panel */
.navbar-dropdown {
    list-style: none;
    margin: 0;
    padding: 8px;
    position: absolute;
    top: calc(100% + 24px);
    left: 50%;
    min-width: 220px;
    background-color: var(--color-white);
    border-radius: 4px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.10);
    border: 1px solid rgba(0, 0, 0, 0.06);
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(6px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
    z-index: 1100;
}

@media (hover: hover) {
    .navbar-item.has-dropdown:hover > .navbar-dropdown,
    .navbar-item.has-dropdown:focus-within > .navbar-dropdown {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(0);
    }
}

/* Right-aligned variant (language switcher) — must come after the base
   .navbar-dropdown rule above so its `right: 0` + plain translateY wins
   the cascade instead of inheriting the base rule's translateX(-50%)
   centering transform, which fights the right-anchored positioning. */
.lang-avatar-dropdown {
    left: auto;
    right: 0;
    max-width: calc(100vw - 2 * var(--horizontal-padding));
    transform: translateY(6px);
    z-index: 1700;
}

@media (hover: hover) {
    .navbar-item.has-dropdown:hover > .lang-avatar-dropdown,
    .navbar-item.has-dropdown:focus-within > .lang-avatar-dropdown {
        transform: translateY(0);
    }
}

.navbar-dropdown .navbar-item {
    width: 100%;
}

.navbar-dropdown .navbar-link {
    width: 100%;
    justify-content: flex-start;
    padding: 10px 12px;
    font-size: 14px;
    border-radius: 3px;
}

/* Long dropdowns (e.g. Books: Class 1-12) flow into fixed columns of 4 items
   each — 1st-4th in column 1, 5th-8th in column 2, 9th-12th in column 3.
   Sub-dropdowns (streams) always show as a hover flyout, never inline, so
   every column keeps exactly 4 rows regardless of which classes have streams. */
.navbar-dropdown--grid {
    display: grid;
    grid-auto-flow: column;
    grid-template-rows: repeat(4, auto);
    column-gap: 16px;
    width: 480px;
    max-width: 90vw;
    overflow: visible;
}

/* Nested sub-dropdown, opens to the side on desktop */
.navbar-item.has-subdropdown {
    position: relative;
}

.navbar-subdropdown {
    list-style: none;
    margin: 0;
    padding: 8px;
    position: absolute;
    top: 8px;
    left: calc(100% + 8px);
    min-width: 200px;
    background-color: var(--color-white);
    border-radius: 4px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.10);
    border: 1px solid rgba(0, 0, 0, 0.06);
    opacity: 0;
    visibility: hidden;
    transform: translateX(-6px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
    z-index: 1200;
}

@media (hover: hover) {
    .navbar-item.has-subdropdown:hover > .navbar-subdropdown,
    .navbar-item.has-subdropdown:focus-within > .navbar-subdropdown {
        opacity: 1;
        visibility: visible;
        transform: translateX(0);
    }
}

.navbar-subdropdown .navbar-link {
    font-size: 14px;
    padding: 10px 12px;
    border-radius: 3px;
}

/* Custom CSS Mobile Toggler (No JS) */
.menu-toggle-checkbox {
    display: none;
}

.menu-toggle-btn {
    display: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
    width: 24px;
    padding: 4px;
    z-index: 1001;
}

.menu-toggle-btn .bar {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--color-primary-text);
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Responsive Rules: Navbar — whole menu expands inline below the header,
   pushing page content down (no fixed drawer, no overlay). */
@media (max-width: 768px) {
    .navbar-container {
        justify-content: flex-start;
    }

    .menu-toggle-btn {
        display: flex;
        order: -1;
        position: relative;
        z-index: 1600;
    }

    .navbar-brand {
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
    }

    .navbar-menu-panel {
        display: none;
        position: fixed;
        top: var(--navbar-height);
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1500;
        flex-direction: column;
        background-color: var(--color-white);
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
    }

    .menu-toggle-checkbox:checked ~ .navbar-menu-panel {
        display: flex;
    }

    .navbar-menu-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-shrink: 0;
        padding: 14px var(--horizontal-padding);
        border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    }

    .navbar-menu-title {
        font-size: 13px;
        font-weight: 700;
        color: var(--color-primary-text);
        letter-spacing: 0.08em;
        text-transform: uppercase;
    }

    .navbar-menu-vscroll {
        display: flex;
        flex-direction: column;
        flex: 1;
        min-height: 0;
    }

    .navbar-menu-vscroll .vscroll-arrow {
        display: flex;
    }

    .navbar-menu {
        display: flex;
        width: 100%;
        margin: 0;
        padding: 4px var(--horizontal-padding) 20px var(--horizontal-padding);
        box-sizing: border-box;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        overflow-y: auto;
        flex: 1;
        min-height: 0;
    }

    .navbar-menu .navbar-item {
        width: 100%;
    }

    .navbar-menu .navbar-item.has-dropdown,
    .navbar-menu .navbar-item.has-subdropdown {
        position: relative;
    }

    .navbar-menu .navbar-link {
        display: flex;
        width: 100%;
        box-sizing: border-box;
        padding: 12px;
    }

    .navbar-menu .navbar-item.has-dropdown > .navbar-link,
    .navbar-menu .navbar-item.has-subdropdown > .navbar-link {
        padding-right: 44px;
    }

    .navbar-dropdown-caret {
        display: flex;
        position: absolute;
        top: 4px;
        right: 0;
    }

    /* Transform Hamburger menu icon into an 'X' when the panel is open —
       the only close control, so there's never a duplicate icon. */
    .menu-toggle-checkbox:checked ~ .menu-toggle-btn .bar:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }
    .menu-toggle-checkbox:checked ~ .menu-toggle-btn .bar:nth-child(2) {
        opacity: 0;
    }
    .menu-toggle-checkbox:checked ~ .menu-toggle-btn .bar:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    /* Top-level and nested dropdowns both become plain in-flow accordion
       panels right below their trigger, stacked vertically regardless of
       the desktop multi-column grid layout. The language switcher's
       dropdown is excluded — it stays a floating right-anchored popup
       even on mobile, since it lives in the collapsed header, not the
       drawer's accordion list. */
    .navbar-dropdown:not(.lang-avatar-dropdown),
    .navbar-subdropdown {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        display: none;
        min-width: 0;
        width: 100%;
        max-width: none;
        max-height: none;
        margin: 4px 0 0 0;
        padding: 4px 0 4px 12px;
        background-color: var(--color-secondary-bg);
        grid-auto-flow: unset;
        grid-template-rows: none;
        column-gap: 0;
    }

    .navbar-item.has-dropdown.is-open > .navbar-dropdown:not(.lang-avatar-dropdown),
    .navbar-item.has-subdropdown.is-open > .navbar-subdropdown {
        display: block;
    }

    .navbar-item.has-dropdown.is-open > .lang-avatar-dropdown {
        display: block;
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .navbar-dropdown:not(.lang-avatar-dropdown) .navbar-item,
    .navbar-subdropdown .navbar-item {
        padding: 0;
    }

    /* Language switcher stays visible in the collapsed header, pinned to
       the right, regardless of whether the menu panel is open. */
    .lang-avatar-item {
        margin-left: auto;
        position: relative;
        z-index: 1600;
    }
}

/* ==========================================================================
   App Layout: Sidebar (pattern list / navigation) + Main content
   ========================================================================== */
/* Home page shell */
.home-page {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.home-page-shell {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.breadcrumb {
    margin-bottom: 12px;
}

.breadcrumb-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.breadcrumb-link {
    color: var(--color-grey);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.breadcrumb-link:hover {
    color: var(--color-primary);
}

.breadcrumb-current {
    color: var(--color-primary-text);
    font-size: 13px;
    font-weight: 700;
}

.breadcrumb-separator {
    color: var(--color-grey);
    font-size: 16px;
    line-height: 1;
    opacity: 0.6;
}

.page-header {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.page-title {
    margin: 0 0 6px 0;
    font-size: clamp(1.75rem, 4vw, 2.4rem);
    line-height: 1.15;
    font-weight: 800;
    color: var(--color-primary-text);
}

.page-subtitle {
    margin: 0;
    color: var(--color-grey);
    font-size: 15px;
    line-height: 1.6;
}

.content-page {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.content-page-shell {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.content-grid {
    display: grid;
    gap: 16px;
}

.content-grid--two {
    grid-template-columns: 1fr;
}

.contact-page-grid {
    width: 100%;
    max-width: 768px;
    margin: 0;
}

.page-panel {
    background: none;
    border: none;
    border-radius: 0;
    padding: 24px 0 0 0;
    box-shadow: none;
}

.page-panel + .page-panel {
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.panel-title {
    margin: 0 0 12px 0;
    font-size: 18px;
    line-height: 1.2;
    font-weight: 800;
    color: var(--color-primary-text);
}

.not-found-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    border-top: none;
    padding: 56px 28px;
    margin: 40px auto;
    max-width: 480px;
}

.not-found-code {
    margin: 0;
    font-size: 64px;
    font-weight: 800;
    color: var(--color-primary);
    line-height: 1;
}

.not-found-home-btn {
    margin-top: 12px;
}

.panel-text {
    margin: 0 0 12px 0;
    color: var(--color-primary-text);
    font-size: 15px;
    line-height: 1.7;
}

.panel-text:last-child {
    margin-bottom: 0;
}

.plain-list {
    margin: 0;
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    color: var(--color-primary-text);
    line-height: 1.6;
}

.contact-details {
    display: grid;
    gap: 14px;
    margin-top: 20px;
}

.detail-label {
    margin: 0 0 4px 0;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-grey);
}

.detail-value {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--color-primary-text);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.subject-tabs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
}

.subject-tabs::-webkit-scrollbar {
    display: none;
}

.subject-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.10);
    background-color: var(--color-white);
    color: var(--color-primary-text);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.18s ease;
}

.subject-tab:hover {
    border-color: var(--color-primary);
    background-color: rgba(67, 166, 78, 0.08);
    color: var(--color-primary);
}

.subject-tab.active {
    border-color: var(--color-primary);
    background-color: var(--color-primary);
    color: var(--color-white);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--color-primary-text);
}

.input-field {
    border-radius: var(--border-radius-sm);
}

textarea.input-field {
    min-height: 140px;
    resize: vertical;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.contact-submit-btn {
    border-radius: var(--border-radius-sm);
}

.form-message {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--color-grey);
    min-height: 20px;
}

.form-message.is-success {
    color: var(--color-primary);
}

.form-message.is-error {
    color: #b42318;
}

.home-layout {
    display: flex;
    width: 100%;
    gap: 18px;
    align-items: flex-start;
}

.home-sidebar {
    background-color: var(--color-white);
    border-radius: 4px;
    position: sticky;
    top: 24px;
    max-height: calc(100vh - var(--navbar-height) - 24px - 20px);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-sizing: border-box;
    flex-shrink: 0;
    width: 260px;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.class-sidebar-vscroll {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.class-sidebar-track {
    padding: 18px;
    overflow-y: auto;
    box-sizing: border-box;
    flex: 1;
    min-height: 0;
}

.bottom-sheet-header {
    padding: 18px 18px 0 18px;
    margin-bottom: -6px;
}

.bottom-sheet-handle {
    display: none;
}

.bottom-sheet-title-row {
    display: block;
}

.sidebar-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--color-primary-text);
    margin-top: 0;
    margin-bottom: 14px;
    border-bottom: 0;
    padding-bottom: 0;
    display: inline-block;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.class-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.class-item {
    position: relative;
}

.class-link {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 12px;
    border-radius: 6px;
    border: none;
    background: none;
    color: var(--color-primary-text);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.15s ease;
}

.class-link:hover {
    background-color: rgba(67, 166, 78, 0.08);
    color: var(--color-primary);
}

.class-link.active {
    background-color: var(--color-primary);
    color: var(--color-white);
}

.class-link.active .navbar-item-avatar {
    background-color: var(--color-white);
    color: var(--color-primary);
}

.class-link--static {
    cursor: default;
}

.class-link--static:hover {
    background-color: transparent;
    color: var(--color-primary-text);
}

.class-link-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stream-select {
    padding-left: 10px;
    border-left: 2px solid rgba(67, 166, 78, 0.25);
}

.stream-select--inline {
    margin-top: 8px;
}

/* Hover/focus reveal for non-active classes, so streams are reachable
   without first navigating into the class. Expands inline below the
   class link rather than as an absolutely-positioned flyout, so it
   can't be clipped by the sidebar's own scroll container. */
.stream-select--flyout {
    max-height: 0;
    margin-top: 0;
    padding-top: 0;
    padding-bottom: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.2s ease, opacity 0.2s ease, margin-top 0.2s ease;
}

.class-item.has-streams:hover > .stream-select--flyout,
.class-item.has-streams:focus-within > .stream-select--flyout {
    max-height: 320px;
    margin-top: 8px;
    padding-top: 2px;
    padding-bottom: 2px;
    opacity: 1;
}

.stream-select-title {
    margin: 0 0 6px 0;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-grey);
}

.stream-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stream-link {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 12px;
    border-radius: 6px;
    border: none;
    background: none;
    color: var(--color-primary-text);
    text-decoration: none;
    font-weight: 500;
    font-size: 13px;
    transition: all 0.15s ease;
}

.stream-link:hover {
    background-color: rgba(67, 166, 78, 0.08);
    color: var(--color-primary);
}

.stream-link.active {
    background-color: var(--color-primary);
    color: var(--color-white);
}

.stream-link-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-main {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    width: 100%;
}

.mobile-filter-bar {
    display: none;
}

.filter-toggle-pill {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: fit-content;
    max-width: 100%;
    font-size: 14px;
    font-weight: 600;
    padding: 12px 16px;
    margin-bottom: 20px;
    background-color: var(--color-white);
    color: var(--color-primary-text);
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 999px;
    box-sizing: border-box;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.filter-toggle-pill-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 220px;
}

.filter-toggle-pill-chevron {
    flex-shrink: 0;
    color: var(--color-grey);
}

/* Books Grid */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 16px;
    width: 100%;
}

/* Home page: Books / Solutions / Playlists preview sections */
.home-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.home-section + .home-section {
    margin-top: 28px;
}

.home-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.home-section-title {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    color: var(--color-primary-text);
}

.home-section-see-all {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-primary);
    text-decoration: none;
    white-space: nowrap;
}

.home-section-see-all:hover {
    text-decoration: underline;
}

.horizontal-scroll-row {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: none;
}

.horizontal-scroll-row::-webkit-scrollbar {
    display: none;
}

/* Common horizontal-scroll wrapper with edge arrows (used by book rows and subject tabs) */
.hscroll {
    position: relative;
}

.hscroll-track {
    scrollbar-width: none;
}

.hscroll-track::-webkit-scrollbar {
    display: none;
}

.hscroll-arrow {
    position: absolute;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    width: 48px;
    border: none;
    background: none;
    color: var(--color-primary-text);
    cursor: pointer;
    z-index: 2;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.18s ease;
}

.hscroll-arrow svg {
    width: 20px;
    height: 20px;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.15));
}

.hscroll.is-scrollable-start .hscroll-arrow--prev,
.hscroll.is-scrollable-end .hscroll-arrow--next {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.hscroll-arrow--prev {
    left: 0;
    justify-content: flex-start;
    padding-left: 4px;
    background: linear-gradient(to right, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0));
}

.hscroll-arrow--next {
    right: 0;
    justify-content: flex-end;
    padding-right: 4px;
    background: linear-gradient(to left, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0));
}

@media (hover: hover) {
    .hscroll-arrow:hover {
        color: var(--color-primary);
    }
}

/* Common vertical-scroll wrapper with edge arrows (mirrors .hscroll, used for tall lists like the book reader sidebar) */
.vscroll {
    position: relative;
}

.vscroll-track {
    scrollbar-width: none;
}

.vscroll-track::-webkit-scrollbar {
    display: none;
}

.vscroll-arrow {
    position: absolute;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    height: 40px;
    border: none;
    background: none;
    color: var(--color-primary-text);
    cursor: pointer;
    z-index: 2;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.18s ease;
}

.vscroll-arrow svg {
    width: 18px;
    height: 18px;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.15));
}

.vscroll.is-scrollable-start .vscroll-arrow--prev,
.vscroll.is-scrollable-end .vscroll-arrow--next {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.vscroll-arrow--prev {
    top: 0;
    align-items: flex-start;
    padding-top: 4px;
    background: linear-gradient(to bottom, var(--color-white) 40%, rgba(255, 255, 255, 0));
}

.vscroll-arrow--next {
    bottom: 0;
    align-items: flex-end;
    padding-bottom: 4px;
    background: linear-gradient(to top, var(--color-white) 40%, rgba(255, 255, 255, 0));
}

@media (hover: hover) {
    .vscroll-arrow:hover {
        color: var(--color-primary);
    }
}

.book-card--scroll {
    flex: 0 0 150px;
    width: 150px;
}

.book-card {
    margin: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    color: inherit;
    text-decoration: none;
    transition: transform 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background-color: var(--color-white);
    border-radius: 4px;
    cursor: pointer;
    padding: 0;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.book-card:hover {
    transform: translateY(-3px);
    border-color: rgba(67, 166, 78, 0.22);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.book-cover-container {
    width: 100%;
    aspect-ratio: 2/3;
    background: rgba(0, 0, 0, 0.02);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.book-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.book-card:hover .book-cover {
    transform: scale(1.04);
}

.book-info {
    padding: 12px;
    text-align: left;
    flex-grow: 1;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    flex-direction: column;
    gap: 4px;
}

.book-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--color-primary-text);
    margin: 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    letter-spacing: 0.01em;
    min-height: calc(13px * 1.5 * 2);
}

.book-meta {
    margin: 0;
    font-size: 12px;
    color: var(--color-grey);
}

.books-grid--page {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 8px;
    padding: 48px 20px;
}

.empty-state-icon {
    color: var(--color-grey);
    opacity: 0.7;
    margin-bottom: 4px;
}

.empty-state-title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--color-primary-text);
}

.empty-state-subtitle {
    margin: 0;
    max-width: 320px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--color-grey);
}

.sidebar-toggle-checkbox {
    display: none;
}

/* Backdrop Blur Overlay — used by any checkbox-driven bottom sheet
   (class sidebar, book reader chapter list), so it's not scoped to a
   single breakpoint. */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 1999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(2px);
}

/* Mobile & Tablet Bottom Sheet Styling */
@media (max-width: 768px) {
    .home-layout {
        display: block;
        padding: 0;
    }

    .home-page-shell {
        gap: 12px;
    }

    .mobile-filter-bar {
        display: block;
    }

    .home-sidebar {
        width: auto;
    }

    .sidebar-toggle-checkbox:checked ~ .sidebar-overlay {
        opacity: 1;
        pointer-events: auto;
    }

    /* Bottom Sheet */
    .home-sidebar {
        position: fixed;
        top: auto;
        bottom: -100%;
        left: 0;
        right: 0;
        max-width: 100vw;
        height: auto;
        max-height: 80vh;
        background-color: var(--color-white);
        border-radius: 6px 6px 0 0;
        box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
        border: 1px solid rgba(0, 0, 0, 0.06);
        transition: bottom 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
        z-index: 2000;
        box-sizing: border-box;
        overflow-x: hidden;
    }

    .sidebar-toggle-checkbox:checked ~ .home-sidebar {
        bottom: 0;
    }

    .home-sidebar .class-sidebar-track {
        max-height: calc(80vh - 60px);
        padding: 16px var(--horizontal-padding) 40px var(--horizontal-padding);
    }

    .bottom-sheet-handle {
        display: block;
        width: 36px;
        height: 5px;
        background-color: var(--color-grey);
        border-radius: 3px;
        margin: 0 auto 16px auto;
        opacity: 0.4;
    }

    .bottom-sheet-title-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        margin-bottom: 12px;
    }

    .sidebar-title {
        margin: 0;
        font-size: 13px;
        border-bottom: none;
        padding-bottom: 0;
    }

    .book-info {
        padding: 10px 12px 12px 12px;
    }

    .book-title {
        font-size: 13px;
    }

    .page-panel {
        padding-top: 18px;
    }

    .subject-tabs {
        gap: 8px;
    }

    .subject-tab {
        padding: 9px 14px;
    }
}

/* ==========================================================================
   Android App Banners
   ========================================================================== */
.android-app-banner {
    background: var(--color-primary-bg);
    color: var(--color-white);
}

.android-app-banner-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 18px var(--horizontal-padding);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.android-app-banner-title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--color-white);
}

.android-app-banner-subtitle {
    margin: 2px 0 0 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
}

.android-app-banner-badge {
    display: inline-flex;
    flex-shrink: 0;
    line-height: 0;
    transition: opacity 0.2s;
}

.android-app-banner-badge:hover {
    opacity: 0.85;
}

.android-app-banner-badge-img {
    height: 48px;
    width: auto;
    aspect-ratio: 238.96 / 70.87;
    display: block;
}

.book-detail-android-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--color-secondary-bg);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--border-radius-lg);
    padding: 12px 14px;
    margin-bottom: var(--section-gap);
    text-decoration: none;
    color: var(--color-primary-text);
    transition: opacity 0.2s;
}

.book-detail-android-banner:hover {
    opacity: 0.9;
}

.book-detail-android-banner-badge-img {
    height: 40px;
    width: auto;
    aspect-ratio: 238.96 / 70.87;
    display: block;
    flex-shrink: 0;
}

.book-detail-android-banner-text {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.book-detail-android-banner-title {
    font-size: 14px;
    font-weight: 700;
}

.book-detail-android-banner-subtitle {
    font-size: 12px;
    color: var(--color-grey);
}

@media (max-width: 480px) {
    .book-detail-android-banner-subtitle {
        display: none;
    }
}

/* ==========================================================================
   Footer
   ========================================================================== */
.app-footer {
    margin-top: auto;
    background: var(--color-secondary-bg);
    color: var(--color-primary-text);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px var(--horizontal-padding);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    flex-wrap: wrap;
}

.footer-brand-block {
    display: flex;
    align-items: center;
    gap: 14px;
    max-width: 480px;
}

.footer-brand {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    margin: 0;
    text-decoration: none;
}

.footer-brand-logo {
    height: 128px;
    width: 128px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    flex-shrink: 0;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.footer-tagline {
    color: var(--color-grey);
    font-size: 14px;
    margin: 0;
    line-height: 1.7;
}

.footer-columns {
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
}

.footer-col-title {
    font-size: 13px;
    font-weight: 800;
    color: var(--color-primary-text);
    margin: 0 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.footer-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-link {
    color: var(--color-grey);
    text-decoration: none;
    font-size: 14px;
    opacity: 1;
    transition: opacity 0.2s, color 0.2s;
}

.footer-link:hover {
    color: var(--color-primary);
}

.text-primary-link {
    color: var(--color-primary);
}

.footer-text {
    color: var(--color-grey);
    font-size: 14px;
}

.footer-text:hover {
    color: var(--color-primary);
}

.footer-bottom {
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    padding: 16px var(--horizontal-padding);
    text-align: center;
    color: var(--color-grey);
    font-size: 13px;
}

/* Responsive Rules: Footer */
@media (max-width: 768px) {
    .footer-container {
        flex-direction: column;
        gap: 32px;
    }

    .footer-columns {
        gap: 32px;
        width: 100%;
    }

    .footer-tagline {
        max-width: none;
    }
}

/* Book Reader */
.book-reader-header {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.book-reader-cover {
    flex: 0 0 96px;
    width: 96px;
    height: 128px;
    border-radius: 8px;
    overflow: hidden;
    background-color: var(--color-white);
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.book-reader-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.book-reader-meta {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.book-reader-title {
    margin: 0;
    font-size: clamp(1.4rem, 3vw, 1.9rem);
    font-weight: 800;
    color: var(--color-primary-text);
}

.book-reader-meta-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.book-reader-meta-list li {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-grey);
    background-color: rgba(15, 23, 42, 0.05);
    border-radius: 999px;
    padding: 4px 12px;
}

.book-reader-layout {
    display: flex;
    width: 100%;
    gap: 18px;
    align-items: flex-start;
    margin-top: 18px;
}

.book-reader-sidebar {
    background-color: var(--color-white);
    border-radius: 4px;
    position: sticky;
    top: 24px;
    max-height: calc(100vh - var(--navbar-height) - 24px - 20px);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-sizing: border-box;
    flex-shrink: 0;
    width: 260px;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.book-reader-sidebar-vscroll {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.book-reader-sidebar-track {
    padding: 16px;
    overflow-y: auto;
    box-sizing: border-box;
    flex: 1;
    min-height: 0;
}

.sidebar-group + .sidebar-group {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.sidebar-group .sidebar-title {
    margin: 0 0 8px 0;
}

.chapter-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.chapter-link {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    text-align: left;
    padding: 8px 12px;
    border-radius: 6px;
    border: none;
    background: none;
    color: var(--color-primary-text);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.chapter-link:hover {
    background-color: rgba(67, 166, 78, 0.08);
    color: var(--color-primary);
}

.chapter-link.active {
    background-color: var(--color-primary);
    color: var(--color-white);
}

.chapter-avatar {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(15, 23, 42, 0.08);
    color: var(--color-primary-text);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    transition: all 0.15s ease;
}

.chapter-link.active .chapter-avatar {
    background-color: var(--color-white);
    color: var(--color-primary);
}

.chapter-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chapter-avatar-text {
    line-height: 1;
}

.chapter-link-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.book-reader-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.book-reader-viewer-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.book-reader-viewer-title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--color-primary-text);
}

.book-reader-expand-btn {
    flex-shrink: 0;
    padding: 6px 14px;
    font-size: 13px;
}

.book-reader-viewer-frame {
    position: relative;
    width: 100%;
}

.book-reader-zoom-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 6px;
    border-radius: 999px;
    background-color: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
}

.book-reader-zoom-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: none;
    background-color: transparent;
    color: var(--color-white);
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.book-reader-zoom-btn:hover {
    background-color: rgba(255, 255, 255, 0.18);
}

.book-reader-zoom-reset {
    font-size: 13px;
}

.book-reader-zoom-level {
    min-width: 42px;
    text-align: center;
    color: var(--color-white);
    font-size: 12px;
    font-weight: 600;
}

.book-reader-viewer {
    width: 100%;
    aspect-ratio: 210 / 297;
    border-radius: 8px;
    overflow-y: auto;
    overflow-x: hidden;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background-color: #525659;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    position: relative;
    /* Block right-click "Save image as" / print-screen affordances on the rendered pages. */
    user-select: none;
}

.pdf-page {
    background-color: var(--color-white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
    width: 100%;
    aspect-ratio: 210 / 297;
    line-height: 0;
    overflow: hidden;
}

.pdf-page--pending {
    background: linear-gradient(100deg, #f0f0f0 30%, #f8f8f8 50%, #f0f0f0 70%);
    background-size: 200% 100%;
    animation: pdf-page-shimmer 1.4s ease-in-out infinite;
}

@keyframes pdf-page-shimmer {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

.pdf-page canvas {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

.book-reader-viewer-loading,
.book-reader-viewer-error {
    color: var(--color-white);
    font-size: 14px;
    font-weight: 600;
    padding: 40px 0;
}

/* Short documents (<= 15 pages) render at full length, no internal scroll. */
.book-reader-viewer--short {
    aspect-ratio: unset;
    height: auto;
    overflow-y: visible;
}

/* Expanded/fullscreen reading mode: hide the sidebar, let the viewer take
   the full available viewport height. */
.book-reader-page--expanded .book-reader-sidebar,
.book-reader-page--expanded .book-reader-header,
.book-reader-page--expanded .breadcrumb {
    display: none;
}

.book-reader-page--expanded .book-reader-viewer:not(.book-reader-viewer--short) {
    height: calc(100vh - 120px);
    aspect-ratio: unset;
}

.book-reader-page--expanded .book-reader-expand-btn {
    background-color: var(--color-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
}

@media (max-width: 900px) {
    .book-reader-layout {
        flex-direction: column;
        position: relative;
    }

    .book-reader-viewer {
        height: 70vh;
    }

    /* Bottom Sheet (mirrors .home-sidebar's mobile behavior) */
    .book-reader-sidebar {
        position: fixed;
        top: auto;
        bottom: -100%;
        left: 0;
        right: 0;
        width: auto;
        max-width: 100vw;
        height: auto;
        max-height: 80vh;
        border-radius: 6px 6px 0 0;
        box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
        transition: bottom 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
        z-index: 2000;
        box-sizing: border-box;
        overflow-x: hidden;
    }

    #chapter-sidebar-toggle:checked ~ .book-reader-sidebar {
        bottom: 0;
    }

    #chapter-sidebar-toggle:checked ~ .sidebar-overlay {
        opacity: 1;
        pointer-events: auto;
    }

    .book-reader-sidebar-track {
        max-height: calc(80vh - 60px);
    }

    .book-reader-layout > .mobile-filter-bar {
        display: block;
    }
}
