/* ==========================================================================
   Zyx Learning — App Workspace, Standalone Zyx Store, Smart-Books & Inner Pages
   - Strictly Original Zyx Blue (#007bff), Gold (#ffc107), White (#ffffff)
   - Thin 1px stroke (#e2e8f0), Sentence case typography, zero line-wrap bugs
   ========================================================================== */

*, *::before, *::after {
    box-sizing: border-box;
}

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

h1, h2, h3, h4, h5, h6, p, span, strong, small, a, label, button, input, select, textarea {
    overflow-wrap: break-word;
    word-break: break-word;
}

/* 1. App 2-Column Workspace (Alongside 248px Left Sidebar on Dashboard) */
.duo-workspace {
    max-width: 1020px;
    margin: 0 auto;
    padding: 1.75rem 1.25rem 4.5rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: start;
}
@media (min-width: 1040px) {
    .duo-workspace {
        grid-template-columns: minmax(0, 610px) 320px;
        justify-content: center;
        gap: 2.25rem;
        padding: 2rem 1.5rem 5rem;
    }
}

.duo-feed-col {
    width: 100%;
    max-width: 610px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.duo-side-col {
    width: 100%;
    max-width: 610px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}
@media (min-width: 1040px) {
    .duo-side-col {
        max-width: 320px;
        position: sticky;
        top: 5rem;
    }
}

/* Standalone Full-Width Store Page Container */
.duo-store-container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 2rem 1.5rem 5rem;
}
.duo-store-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.25rem;
}
@media (max-width: 540px) {
    .duo-store-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}
.zyx-xp-reward-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.9rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}
@media (max-width: 520px) {
    .zyx-xp-reward-card {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    .zyx-xp-reward-card .duo-btn {
        width: 100%;
        justify-content: center;
    }
}

/* 2. Top Status Bar Items */
.duo-stat-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.84rem;
    font-weight: 700;
    color: #64748b;
    text-decoration: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.32rem 0.55rem;
    border-radius: 8px;
    font-family: inherit;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background-color 0.14s ease;
}
.duo-stat-item:hover {
    background-color: #f8fafc;
}
.duo-stat-item.orange { color: #f59e0b; }
.duo-stat-item.blue   { color: #007bff; }
.duo-stat-item.gold   { color: #d99b00; }

/* 3. Clean Right-Column Bordered Widget Cards (1px Stroke) */
.duo-widget-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 1.25rem;
    box-sizing: border-box;
}
.duo-widget-title {
    margin: 0 0 0.35rem;
    font-size: 1.05rem;
    font-weight: 800;
    color: #1e293b;
    line-height: 1.25;
}
.duo-widget-copy {
    margin: 0 0 1rem;
    font-size: 0.86rem;
    line-height: 1.45;
    color: #64748b;
}
.duo-widget-stack {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}
.duo-widget-stack .duo-btn {
    width: 100%;
}

.duo-widget-head-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}
.duo-widget-head-row h3 {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 800;
    color: #1e293b;
}
.duo-widget-link {
    font-size: 0.8rem;
    font-weight: 700;
    color: #007bff;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    white-space: nowrap;
}
.duo-widget-link:hover {
    text-decoration: underline;
}

/* Quest / Progress Row inside Right Widget */
.duo-quest-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.duo-quest-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #fff8db;
    color: #d99b00;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.duo-quest-body {
    flex: 1;
    min-width: 0;
}
.duo-quest-label {
    font-size: 0.84rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.35rem;
    display: flex;
    justify-content: space-between;
}
.duo-progress-track {
    width: 100%;
    height: 10px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}
.duo-progress-fill {
    height: 100%;
    background: #ffc107;
    border-radius: 999px;
    transition: width 0.3s ease;
}

/* 4. Filter Strip & Unit Header Banners (Original Zyx Blue, Sentence Case) */
.duo-filter-strip {
    display: flex;
    gap: 0.45rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.25rem;
    scrollbar-width: none;
}
.duo-filter-strip::-webkit-scrollbar { display: none; }

.duo-filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.95rem;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #64748b;
    font-family: inherit;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.14s ease;
}
.duo-filter-pill:hover {
    color: #1e293b;
    background: #f8fafc;
}
.duo-filter-pill.active {
    background: #eef5ff;
    border-color: #b8d8ff;
    color: #007bff;
}

/* Clean Unit Header Banner */
.duo-unit-banner {
    border-radius: 16px;
    padding: 1.15rem 1.35rem;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
@media (max-width: 640px) {
    .duo-unit-banner {
        flex-direction: column;
        align-items: flex-start;
        padding: 1.15rem 1rem;
        gap: 0.85rem;
    }
    .duo-unit-banner .duo-unit-btn {
        width: 100%;
        justify-content: center;
    }
}
.duo-unit-banner.blue,
.duo-unit-banner.navy,
.duo-unit-banner.green {
    background-color: #007bff;
    border: 1px solid #0056b3;
}
.duo-unit-banner.gold {
    background-color: #fff8db;
    color: #1e293b;
    border: 1px solid #fde08d;
}
.duo-unit-kicker {
    display: block;
    font-size: 0.74rem;
    font-weight: 700;
    opacity: 0.9;
    margin-bottom: 0.15rem;
}
.duo-unit-title {
    margin: 0;
    font-size: 1.18rem;
    font-weight: 800;
    line-height: 1.25;
}
.duo-unit-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.48rem 0.85rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.14);
    color: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    cursor: pointer;
}
.duo-unit-btn:hover {
    background: rgba(255, 255, 255, 0.24);
}

/* 5. Clean Module Row Cards (1px Stroke, Single-Line Badges) */
.duo-module-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.duo-module-row {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 1rem 1.15rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}
.duo-module-row:hover {
    border-color: #b8d8ff;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}
.duo-module-left {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    min-width: 0;
}
.duo-module-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: #eef5ff;
    color: #007bff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.duo-module-info {
    min-width: 0;
}
.duo-module-title {
    margin: 0 0 0.2rem;
    font-size: 0.98rem;
    font-weight: 800;
    color: #1e293b;
    line-height: 1.25;
}
.duo-module-meta {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 600;
    color: #64748b;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
}
.duo-badge-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.14rem 0.5rem;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}
.duo-badge-pill.free,
.duo-badge-pill.done {
    background: #eef5ff;
    color: #007bff;
}
.duo-badge-pill.pro {
    background: #fff8db;
    color: #9a6b00;
}
.duo-module-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

@media (max-width: 600px) {
    .duo-module-row {
        flex-direction: column;
        align-items: stretch;
    }
    .duo-module-actions {
        width: 100%;
    }
    .duo-module-actions .duo-btn {
        flex: 1;
    }
}

/* ==========================================================================
   6. STEPPED SMART-BOOK READER (1px Stroke)
   ========================================================================== */
.duo-lesson-shell {
    max-width: 760px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 5rem;
}
.duo-lesson-top {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.duo-lesson-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    color: #64748b;
    text-decoration: none;
    font-size: 1.15rem;
    font-weight: 800;
}
.duo-lesson-close:hover {
    color: #1e293b;
    background: #f8fafc;
}
.duo-lesson-bar-track {
    flex: 1;
    height: 12px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}
.duo-lesson-bar-fill {
    height: 100%;
    background: #007bff;
    border-radius: 999px;
    transition: width 0.28s ease;
}
.duo-lesson-step-count {
    font-size: 0.84rem;
    font-weight: 700;
    color: #64748b;
    min-width: 48px;
    text-align: right;
    white-space: nowrap;
}

.duo-lesson-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 1.75rem;
    min-height: 320px;
}
.reader-page-kicker {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    background: #eef5ff;
    color: #007bff;
    font-size: 0.74rem;
    font-weight: 700;
    margin-bottom: 0.55rem;
}
.reader-page-title {
    margin: 0 0 0.85rem;
    font-size: clamp(1.3rem, 2.4vw, 1.65rem);
    font-weight: 800;
    color: #1e293b;
}
.reader-body-text {
    font-size: 1rem;
    line-height: 1.65;
    color: #334155;
}
.reader-key-points {
    margin: 1.15rem 0;
    padding: 1rem 1.15rem;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}
.reader-key-points h4 {
    margin: 0 0 0.5rem;
    font-size: 0.8rem;
    color: #007bff;
}
.reader-key-points ul {
    margin: 0;
    padding-left: 1.15rem;
    display: grid;
    gap: 0.35rem;
    font-size: 0.92rem;
    color: #334155;
}
.reader-formula-box {
    margin: 1.15rem 0;
    padding: 0.9rem;
    border-radius: 12px;
    background: #004080;
    color: #ffffff;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 1rem;
    font-weight: 700;
    text-align: center;
}

.reader-3d-stage {
    margin: 1.15rem 0;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    overflow: hidden;
}
.reader-3d-stage model-viewer {
    width: 100%;
    height: 300px;
    background: transparent;
    --poster-color: transparent;
}
.reader-3d-caption {
    padding: 0.65rem 1rem;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: #64748b;
}
.sim-canvas-wrap {
    margin: 1.15rem 0;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    background: #0f172a;
    padding: 1rem;
    color: #ffffff;
}
.sim-canvas {
    width: 100%;
    height: 220px;
    background: #020617;
    border-radius: 10px;
    display: block;
}
.sim-controls {
    margin-top: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
}
.sim-slider-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
    min-width: 160px;
}
.sim-slider-group label {
    font-size: 0.78rem;
    font-weight: 700;
    color: #93c5fd;
}

/* CBT Options inside Reader */
.cbt-question-block {
    margin-top: 1.15rem;
    padding: 1.15rem;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
}
.cbt-q-text {
    margin: 0 0 0.75rem;
    font-size: 0.96rem;
    font-weight: 700;
    color: #1e293b;
}
.cbt-options {
    display: grid;
    gap: 0.5rem;
}
.cbt-opt-btn {
    text-align: left;
    padding: 0.7rem 0.95rem;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #1e293b;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.12s ease;
}
.cbt-opt-btn:hover {
    background: #f8fafc;
}
.cbt-opt-btn.selected,
.cbt-opt-btn.correct {
    background: #eef5ff;
    border-color: #007bff;
    color: #0056b3;
}
.cbt-opt-btn.wrong {
    background: #fef2f2;
    border-color: #ef4444;
    color: #dc2626;
}
.cbt-explanation {
    margin-top: 0.6rem;
    padding: 0.6rem 0.85rem;
    border-radius: 8px;
    background: #f8fafc;
    font-size: 0.84rem;
    color: #334155;
    display: none;
}
.cbt-explanation.visible {
    display: block;
}

.duo-lesson-footer {
    margin-top: 1.35rem;
    padding-top: 1.15rem;
    border-top: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

/* ==========================================================================
   7. CLEAN INPUTS & INNER PAGE CONTAINERS
   ========================================================================== */
.duo-clean-gate {
    max-width: 400px;
    margin: 1rem auto;
    text-align: center;
    padding: 1.25rem 0.5rem;
}
.duo-clean-gate h3 {
    margin: 0.5rem 0;
    font-size: 1.35rem;
    font-weight: 800;
    color: #1e293b;
}
.duo-clean-gate p {
    margin: 0 0 1.25rem;
    font-size: 0.9rem;
    color: #64748b;
    line-height: 1.5;
}

.duo-input {
    width: 100%;
    height: 44px;
    padding: 0 0.9rem;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #1e293b;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    box-sizing: border-box;
    transition: border-color 0.14s ease, background-color 0.14s ease;
}
.duo-input:focus {
    outline: none;
    border-color: #007bff;
    background: #ffffff;
}
.duo-input.code-upper {
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: center;
}
.voucher-feedback {
    margin-top: 0.65rem;
    padding: 0.55rem 0.8rem;
    border-radius: 10px;
    font-size: 0.84rem;
    font-weight: 700;
}
.voucher-feedback.ok {
    background: #eef5ff;
    color: #0056b3;
}
.voucher-feedback.err {
    background: #fef2f2;
    color: #dc2626;
}

.duo-page-container {
    max-width: 1020px;
    margin: 0 auto;
    padding: 2rem 1.5rem 5rem;
}
@media (max-width: 640px) {
    .duo-page-container,
    .duo-store-container {
        padding: 1.25rem 0.85rem 4rem;
    }
}

/* ==========================================================================
   8. LANDSCAPE 3D FLIPBOOK (MATTE BOOK TEXTURE, ZERO GLARE) + NORMAL WEBPAGE VIEW
   ========================================================================== */
.zyx-flipbook-shell {
    max-width: 1040px;
    margin: 0 auto;
    padding: 1.25rem 1.25rem 4.5rem;
}

.zyx-flipbook-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    margin-bottom: 1rem;
}
.zyx-flipbook-toolbar-left,
.zyx-flipbook-toolbar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.zyx-flip-ctrl-group {
    display: inline-flex;
    align-items: center;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
    overflow: hidden;
}
.zyx-flip-ctrl-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    height: 34px;
    padding: 0 0.75rem;
    border: none;
    background: transparent;
    color: #1e293b;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.12s ease, color 0.12s ease;
}
.zyx-flip-ctrl-btn:hover {
    background: #eef5ff;
    color: #007bff;
}
.zyx-flip-ctrl-btn.active {
    background: #007bff;
    color: #ffffff;
}
.zyx-flip-ctrl-sep {
    width: 1px;
    height: 20px;
    background: #e2e8f0;
}

.zyx-xp-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    height: 34px;
    padding: 0 0.75rem;
    border-radius: 10px;
    background: #fff8db;
    border: 1px solid #fde08d;
    color: #9a6b00;
    font-size: 0.8rem;
    font-weight: 800;
    white-space: nowrap;
}

/* Step Dots / Page Tabs */
.duo-lesson-dots {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    margin-bottom: 0.6rem;
    scrollbar-width: none;
}
.duo-lesson-dots::-webkit-scrollbar { display: none; }
.reader-step-dot {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #64748b;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.14s ease;
}
.reader-step-dot.active {
    background: #007bff;
    border-color: #0056b3;
    color: #ffffff;
}
.reader-step-dot.completed {
    background: #eef5ff;
    border-color: #b8d8ff;
    color: #007bff;
}

/* Landscape Open Book Viewport & Hardcover Frame */
.zyx-flipbook-viewport {
    perspective: 1800px;
    width: 100%;
    margin: 0 auto;
    padding: 0.25rem 0 1.25rem;
}
.zyx-flipbook-frame.landscape {
    position: relative;
    display: flex;
    background: #004080;
    border: 1px solid #002b5c;
    border-radius: 16px;
    padding: 10px 14px 14px 10px;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.12);
    min-height: 480px;
    max-height: min(78vh, 640px);
    box-sizing: border-box;
}

/* Left Open Book Reference Page (Visible on Desktop / Tablets) */
.zyx-flipbook-left-page {
    width: 320px;
    background: #fbf9f5;
    border: 1px solid #e4ded5;
    border-radius: 10px 0 0 10px;
    border-right: none;
    padding: 1.35rem 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: inset -6px 0 12px rgba(15, 23, 42, 0.04);
    box-sizing: border-box;
}
.zyx-left-book-head {
    border-bottom: 1px solid #e8e2d8;
    padding-bottom: 0.85rem;
    margin-bottom: 0.85rem;
}
.zyx-left-book-title {
    margin: 0.35rem 0 0.3rem;
    font-size: 1.05rem;
    font-weight: 800;
    color: #1e293b;
    line-height: 1.25;
}
.zyx-left-book-summary {
    margin: 0;
    font-size: 0.82rem;
    color: #64748b;
    line-height: 1.45;
}
.zyx-left-book-nav {
    flex: 1;
    overflow-y: auto;
    padding-right: 0.25rem;
}
.zyx-left-book-nav-heading {
    display: block;
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #007bff;
    margin-bottom: 0.5rem;
}
.zyx-left-nav-list {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.zyx-left-nav-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.45rem 0.6rem;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: #334155;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    text-align: left;
    transition: all 0.12s ease;
}
.zyx-left-nav-item:hover {
    background: #f1ede5;
    color: #007bff;
}
.zyx-left-nav-item.active {
    background: #eef5ff;
    border-color: #b8d8ff;
    color: #007bff;
}
.zyx-left-book-foot {
    border-top: 1px solid #e8e2d8;
    padding-top: 0.65rem;
    margin-top: 0.65rem;
}

/* Center Book Spine Gutter */
.zyx-flipbook-spine {
    width: 18px;
    background: linear-gradient(90deg, #d8d1c5 0%, #ebe5dc 48%, #cfc8bb 100%);
    border-left: 1px solid #c8c0b2;
    border-right: 1px solid #c8c0b2;
    flex-shrink: 0;
    position: relative;
    box-shadow: inset 0 0 6px rgba(15, 23, 42, 0.08);
}
.zyx-flipbook-spine::after {
    content: "";
    position: absolute;
    top: 12px;
    bottom: 12px;
    left: 8px;
    width: 2px;
    background: repeating-linear-gradient(
        to bottom,
        rgba(0, 64, 128, 0.28) 0px,
        rgba(0, 64, 128, 0.28) 6px,
        transparent 6px,
        transparent 12px
    );
}

/* Right Active Flipping Sheet (Natural Matte Book Paper Texture, Zero Glare) */
.zyx-flipbook-sheet {
    position: relative;
    flex: 1;
    min-width: 0;
    background: #fbf9f5;
    border: 1px solid #e4ded5;
    border-left: none;
    border-radius: 0 10px 10px 0;
    padding: 1.35rem 1.65rem 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transform-origin: left center;
    transform-style: preserve-3d;
    box-shadow:
        2px 2px 0 #ede8e1,
        4px 4px 0 #ded7cb,
        6px 6px 14px rgba(15, 23, 42, 0.08),
        inset 12px 0 16px -8px rgba(30, 20, 10, 0.07);
    overflow: hidden;
    box-sizing: border-box;
}

.zyx-sheet-content-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Zoomable and Scrollable Interior (Fits viewport comfortably) */
.zyx-flipbook-zoom-inner {
    flex: 1;
    overflow-y: auto;
    padding-right: 0.65rem;
    scrollbar-width: thin;
    transform: scale(var(--flip-zoom, 1));
    transform-origin: top left;
    width: calc(100% / var(--flip-zoom, 1));
    transition: transform 0.18s ease, width 0.18s ease;
}

/* Natural Gentle Page-Turning Animation (No harsh distortion or skew) */
@keyframes zyxPageFoldNext {
    0% {
        transform: perspective(1600px) rotateY(0deg);
    }
    35% {
        transform: perspective(1600px) rotateY(-18deg);
        box-shadow: -4px 4px 14px rgba(15, 23, 42, 0.1);
    }
    70% {
        transform: perspective(1600px) rotateY(-6deg);
    }
    100% {
        transform: perspective(1600px) rotateY(0deg);
    }
}

@keyframes zyxPageFoldPrev {
    0% {
        transform: perspective(1600px) rotateY(-16deg);
    }
    100% {
        transform: perspective(1600px) rotateY(0deg);
    }
}

.zyx-flipbook-sheet.turning-next {
    animation: zyxPageFoldNext 0.38s cubic-bezier(0.25, 1, 0.5, 1);
}
.zyx-flipbook-sheet.turning-prev {
    animation: zyxPageFoldPrev 0.34s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Interactive Page Curl Corner (Tactile and Subtle) */
.zyx-page-curl-corner {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, transparent 48%, #e0d8cb 50%, #cfc7b9 68%, #fbf9f5 100%);
    border-top-left-radius: 8px;
    box-shadow: -2px -2px 6px rgba(15, 23, 42, 0.08);
    cursor: pointer;
    transition: width 0.15s ease, height 0.15s ease;
    z-index: 4;
}
.zyx-page-curl-corner:hover {
    width: 48px;
    height: 48px;
}

/* Running Book Page Header & Footer */
.zyx-book-running-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding-bottom: 0.65rem;
    margin-bottom: 0.85rem;
    border-bottom: 1px solid #e8e2d8;
    font-size: 0.76rem;
    font-weight: 700;
    color: #64748b;
}
.zyx-book-folio-footer {
    margin-top: 1rem;
    padding-top: 0.85rem;
    border-top: 1px solid #e8e2d8;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding-right: 1.5rem;
    flex-shrink: 0;
}

/* ==========================================================================
   9. NORMAL WEBPAGE STRUCTURE VIEW (FOR MOBILE & FAST RESPONSIVE STUDY)
   ========================================================================== */
.zyx-webpage-article-view {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin: 1rem auto 3rem;
}
.zyx-webpage-header-card {
    background: #007bff;
    color: #ffffff;
    border-radius: 16px;
    padding: 1.5rem 1.75rem;
    border: 1px solid #0056b3;
}
.zyx-webpage-chapter-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 1.5rem 1.75rem;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.03);
}

/* XP Lock Card inside Premium Pages */
.zyx-xp-unlock-card {
    max-width: 460px;
    margin: 1.25rem auto;
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    text-align: center;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.04);
}
.zyx-xp-unlock-card h2 {
    margin: 0.5rem 0 0.4rem;
    font-size: 1.25rem;
    font-weight: 800;
    color: #1e293b;
}
.zyx-xp-unlock-card p {
    margin: 0 0 1.1rem;
    font-size: 0.88rem;
    line-height: 1.5;
    color: #64748b;
}

/* Normal-State End-of-Book Final Quiz Card */
.zyx-normal-quiz-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 1.75rem;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}
.zyx-quiz-pass-banner {
    margin-top: 1.25rem;
    padding: 1.15rem;
    border-radius: 14px;
    border: 1px solid #b8d8ff;
    background: #eef5ff;
    text-align: center;
}
.zyx-quiz-pass-banner.failed {
    border-color: #fecaca;
    background: #fef2f2;
}

/* Responsive adjustments */
@media (max-width: 860px) {
    .zyx-flipbook-left-page {
        display: none !important;
    }
    .zyx-flipbook-spine {
        display: none !important;
    }
    .zyx-flipbook-sheet {
        border-radius: 12px;
        border-left: 1px solid #e4ded5;
        padding: 1.15rem 1.15rem 1rem;
    }
    .zyx-flipbook-frame.landscape {
        padding: 6px;
    }
}

/* Blurred Preview & Key Lock Gate */
.zyx-preview-locked-wrap {
    position: relative;
    overflow: hidden;
    min-height: 440px;
    border-radius: 14px;
    background: #ffffff;
}
.zyx-preview-blurred-content {
    filter: blur(8px) saturate(0.65);
    -webkit-filter: blur(8px) saturate(0.65);
    opacity: 0.42;
    pointer-events: none;
    user-select: none;
    transform: scale(0.99);
}
.zyx-preview-lock-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 10;
    padding: 1.75rem 1.25rem;
    text-align: center;
}
.zyx-lock-icon-badge {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    background: #eef5ff;
    color: #007bff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.9rem;
    border: 1px solid #b8d8ff;
    box-shadow: 0 4px 14px rgba(0, 123, 255, 0.12);
}
.zyx-preview-lock-overlay h3 {
    margin: 0 0 0.35rem;
    font-size: 1.3rem;
    font-weight: 800;
    color: #1e293b;
}
.zyx-preview-lock-overlay p {
    margin: 0 auto 1.25rem;
    max-width: 420px;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #64748b;
}


