/* BBB Book SEO Manager v1.9.0 */
.bbb-book-box,
.bbb-book-box * {
    box-sizing: border-box;
}

.bbb-book-box {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    margin: 26px 0;
    padding: clamp(14px, 2.4vw, 24px);
    background: #ffffff;
    border: 1px solid #e1e8f0;
    border-radius: 22px;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
    color: #172033;
}

.bbb-book-box a,
.bbb-book-box button {
    -webkit-tap-highlight-color: transparent;
}

.bbb-book-top {
    display: grid;
    grid-template-columns: minmax(150px, 220px) minmax(0, 1fr);
    gap: clamp(16px, 2.4vw, 24px);
    align-items: start;
}

.bbb-book-cover {
    width: 100%;
    max-width: 220px;
    background: #f4f7fb;
    border: 1px solid #e1e8f0;
    border-radius: 18px;
    overflow: hidden;
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bbb-book-cover img {
    width: 100%;
    height: auto;
    display: block;
}

.bbb-book-placeholder {
    width: 110px;
    height: 140px;
    border-radius: 14px;
    background: #e8eff8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 26px;
    color: #415166;
}

.bbb-badge {
    display: inline-flex;
    align-items: center;
    background: #eaf3ff;
    color: #0756a6;
    border-radius: 999px;
    padding: 7px 12px;
    font-weight: 800;
    font-size: 13px;
    margin-bottom: 10px;
}

.bbb-book-content h2,
.bbb-section-card > h3 {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    text-align: left !important;
    color: #111827 !important;
}

.bbb-book-content h2:before,
.bbb-book-content h2:after,
.bbb-section-card > h3:before,
.bbb-section-card > h3:after {
    display: none !important;
    content: none !important;
}

.bbb-book-content h2 {
    margin: 0 0 10px !important;
    font-size: clamp(22px, 3vw, 34px) !important;
    line-height: 1.2 !important;
    overflow-wrap: anywhere;
}

.bbb-book-desc {
    color: #4b5b6c;
    font-size: 16px;
    line-height: 1.65;
    margin-bottom: 18px;
}

.bbb-book-desc p:last-child {
    margin-bottom: 0;
}

.bbb-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 18px 0;
}

.bbb-detail-item {
    background: #f8fbff;
    border: 1px solid #e1e8f0;
    border-radius: 14px;
    padding: 12px;
    min-width: 0;
}

.bbb-detail-item span {
    display: block;
    color: #64748b;
    font-size: 13px;
    margin-bottom: 3px;
}

.bbb-detail-item strong {
    display: block;
    color: #172033;
    font-size: 15px;
    overflow-wrap: anywhere;
}

.bbb-download-btn,
.bbb-table-download,
.bbb-chapter-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 11px 16px;
    border-radius: 14px;
    background: #0b63ce;
    color: #ffffff !important;
    font-weight: 800;
    font-size: 14px;
    text-decoration: none !important;
    box-shadow: 0 10px 22px rgba(11, 99, 206, 0.18);
    white-space: nowrap;
}

.bbb-download-btn:hover,
.bbb-table-download:hover,
.bbb-chapter-download:hover {
    background: #074faa;
    color: #ffffff !important;
}

.bbb-section-card {
    width: 100%;
    margin-top: 22px;
    padding: clamp(14px, 2.1vw, 20px);
    background: #f8fbff;
    border: 1px solid #e1e8f0;
    border-radius: 18px;
    overflow: hidden;
}

.bbb-section-card > h3 {
    margin: 0 0 14px !important;
    font-size: clamp(19px, 2.4vw, 24px) !important;
    line-height: 1.25 !important;
    font-weight: 800 !important;
    overflow-wrap: anywhere;
}

.bbb-chapter-list {
    columns: 2;
    column-gap: 30px;
    margin: 0;
    padding-left: 22px;
}

.bbb-chapter-list li {
    margin-bottom: 9px;
    break-inside: avoid;
}

.bbb-faqs details {
    background: #ffffff;
    border: 1px solid #e1e8f0;
    border-radius: 14px;
    padding: 13px 15px;
    margin-bottom: 10px;
}

.bbb-faqs summary {
    cursor: pointer;
    font-weight: 800;
}

.bbb-faqs details div {
    margin-top: 10px;
    color: #4b5b6c;
    line-height: 1.65;
}

.bbb-chapter-pdf-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.bbb-chapter-pdf-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    background: #ffffff;
    border: 1px solid #e1e8f0;
    border-radius: 16px;
    padding: 14px;
}

.bbb-chapter-pdf-info {
    min-width: 0;
    flex: 1 1 220px;
}

.bbb-chapter-pdf-info span,
.bbb-chapter-count {
    display: block;
    color: #0756a6;
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: .02em;
}

.bbb-chapter-pdf-info strong,
.bbb-chapter-title-link {
    display: block;
    color: #172033 !important;
    font-size: 15px;
    line-height: 1.35;
    font-weight: 800;
    text-decoration: none !important;
    overflow-wrap: anywhere;
}

.bbb-chapter-title-link:hover {
    color: #0b63ce !important;
}

.bbb-chapter-pdf-info em {
    display: block;
    margin-top: 4px;
    color: #64748b;
    font-style: normal;
    font-size: 13px;
}

.bbb-card-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.bbb-table-link,
.bbb-chapter-page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 12px;
    border-radius: 11px;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none !important;
    white-space: nowrap;
    background: #eef6ff;
    color: #0756a6 !important;
    border: 1px solid #cfe5ff;
}

.bbb-muted {
    color: #8a97a8;
    font-size: 13px;
}

.bbb-chapter-table-wrap {
    width: 100%;
    overflow: visible;
}

.bbb-chapter-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #ffffff;
    border: 1px solid #e1e8f0;
    border-radius: 16px;
    overflow: hidden;
    table-layout: auto;
}

.bbb-chapter-table th,
.bbb-chapter-table td {
    padding: 13px 14px;
    border-bottom: 1px solid #e1e8f0;
    text-align: left;
    vertical-align: middle;
}

.bbb-chapter-table th {
    background: #eef6ff;
    color: #172033;
    font-size: 13px;
    font-weight: 800;
}

.bbb-chapter-table tr:last-child td {
    border-bottom: 0;
}

.bbb-reader-box {
    width: 100%;
    max-width: 100%;
    margin-top: 18px;
    background: #ffffff;
    border: 1px solid #d7e4f3;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.bbb-reader-compact {
    margin-top: 0;
    box-shadow: none;
    border-radius: 14px;
}

.bbb-reader-compact:not(.is-open) {
    display: none;
}

.bbb-reader-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px;
    background: #f8fbff;
}

.bbb-reader-head strong {
    display: block;
    color: #172033;
    font-size: 15px;
    line-height: 1.35;
}

.bbb-reader-head span {
    display: block;
    margin-top: 3px;
    color: #64748b;
    font-size: 13px;
    line-height: 1.45;
}

.bbb-reader-btn,
.bbb-table-read,
.bbb-chapter-read {
    appearance: none;
    border: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 9px 13px;
    border-radius: 12px;
    background: #0f7a3b;
    color: #ffffff !important;
    border: 1px solid #0f7a3b;
    font-weight: 800;
    font-size: 13px;
    text-decoration: none !important;
    white-space: nowrap;
    line-height: 1.2;
}

.bbb-table-read,
.bbb-chapter-read {
    background: #ecfdf3;
    color: #116236 !important;
    border-color: #bdebcf;
}

.bbb-table-read.is-loaded,
.bbb-chapter-read.is-loaded {
    background: #0f7a3b;
    color: #ffffff !important;
    border-color: #0f7a3b;
}

.bbb-reader-btn:hover,
.bbb-table-read:hover,
.bbb-chapter-read:hover {
    filter: brightness(0.96);
}

.bbb-pdf-frame-wrap {
    width: 100%;
    background: #eef3f9;
    border-top: 1px solid #d7e4f3;
}

.bbb-pdf-frame-wrap[hidden],
.bbb-reader-table-row[hidden] {
    display: none !important;
}

.bbb-reader-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #ffffff;
    border-bottom: 1px solid #d7e4f3;
}

.bbb-reader-toolbar strong {
    display: block;
    min-width: 0;
    color: #172033;
    font-size: 14px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.bbb-reader-toolbar a {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 7px 12px;
    border-radius: 10px;
    background: #eef6ff;
    color: #0756a6 !important;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none !important;
    border: 1px solid #cfe5ff;
}

.bbb-pdf-frame {
    display: block;
    width: 100%;
    height: min(var(--bbb-reader-height, 720px), 82vh);
    min-height: 520px;
    border: 0;
    background: #ffffff;
}

.bbb-reader-box.is-open .bbb-reader-head {
    border-bottom: 1px solid #d7e4f3;
}

.bbb-reader-table-row td {
    padding: 10px !important;
    background: #f8fbff;
}

@media (max-width: 1024px), (max-device-width: 1024px) {
    .bbb-book-top {
        grid-template-columns: 170px minmax(0, 1fr);
        gap: 16px;
    }

    .bbb-book-cover {
        max-width: 170px;
        min-height: 210px;
    }

    .bbb-book-content h2 {
        font-size: 24px !important;
    }

    .bbb-chapter-table,
    .bbb-chapter-table thead,
    .bbb-chapter-table tbody,
    .bbb-chapter-table th,
    .bbb-chapter-table td,
    .bbb-chapter-table tr {
        display: block;
    }

    .bbb-chapter-table {
        border: 0;
        background: transparent;
        border-radius: 0;
    }

    .bbb-chapter-table thead {
        display: none;
    }

    .bbb-chapter-table tbody {
        display: grid;
        gap: 12px;
    }

    .bbb-chapter-table tr {
        background: #ffffff;
        border: 1px solid #e1e8f0;
        border-radius: 16px;
        padding: 12px;
        overflow: hidden;
    }

    .bbb-chapter-table tr.bbb-reader-table-row {
        margin-top: -12px;
        border-top: 0;
        border-radius: 0 0 16px 16px;
        padding: 0;
    }

    .bbb-chapter-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        border-bottom: 1px solid #eef2f6;
        padding: 9px 0;
        min-width: 0;
    }

    .bbb-chapter-table td:last-child {
        border-bottom: 0;
    }

    .bbb-chapter-table td:before {
        content: attr(data-label);
        flex: 0 0 118px;
        color: #64748b;
        font-size: 13px;
        font-weight: 800;
    }

    .bbb-reader-table-row td {
        display: block;
        padding: 0 !important;
        border: 0;
    }

    .bbb-reader-table-row td:before {
        display: none !important;
        content: none !important;
    }
}

@media (max-width: 760px), (max-device-width: 760px) {
    .bbb-book-box {
        margin: 18px 0;
        padding: 12px;
        border-radius: 18px;
    }

    .bbb-book-top,
    .bbb-detail-grid,
    .bbb-chapter-pdf-grid {
        grid-template-columns: 1fr;
    }

    .bbb-book-cover {
        max-width: 210px;
        min-height: 220px;
        margin: 0 auto;
    }

    .bbb-badge {
        font-size: 12px;
        padding: 6px 10px;
    }

    .bbb-book-content h2 {
        font-size: 22px !important;
    }

    .bbb-book-desc {
        font-size: 15px;
    }

    .bbb-chapter-list {
        columns: 1;
    }

    .bbb-preview-actions,
    .bbb-reader-head,
    .bbb-card-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .bbb-reader-head {
        padding: 12px;
    }

    .bbb-reader-btn,
    .bbb-table-read,
    .bbb-chapter-read,
    .bbb-download-btn,
    .bbb-chapter-download,
    .bbb-chapter-page-link,
    .bbb-table-link,
    .bbb-table-download {
        width: 100%;
        min-height: 42px;
    }

    .bbb-chapter-table td {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }

    .bbb-chapter-table td:before {
        flex: 0 0 auto;
    }

    .bbb-reader-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .bbb-reader-toolbar a {
        width: 100%;
    }

    .bbb-pdf-frame {
        height: 76vh;
        min-height: 460px;
    }
}

@media (max-width: 480px), (max-device-width: 480px) {
    .bbb-book-box {
        padding: 10px;
        border-radius: 16px;
    }

    .bbb-section-card {
        padding: 12px;
        border-radius: 16px;
    }

    .bbb-book-cover {
        max-width: 190px;
        min-height: 205px;
    }

    .bbb-book-content h2 {
        font-size: 20px !important;
    }

    .bbb-detail-item {
        padding: 10px;
    }

    .bbb-chapter-table tbody {
        gap: 10px;
    }

    .bbb-chapter-table tr {
        padding: 10px;
    }

    .bbb-pdf-frame {
        height: 72vh;
        min-height: 420px;
    }
}

/* v1.8.0 PDF.js reader fixes */
.bbb-pdf-js-viewer {
    width: 100%;
    max-width: 100%;
    min-height: min(var(--bbb-reader-height, 720px), 82vh);
    max-height: none;
    padding: 10px;
    overflow-x: hidden;
    overflow-y: auto;
    background: #f3f7fb;
    -webkit-overflow-scrolling: touch;
}

.bbb-pdf-placeholder,
.bbb-pdf-status {
    width: 100%;
    padding: 16px;
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid #d7e4f3;
    color: #334155;
    font-size: 14px;
    line-height: 1.5;
    text-align: center;
}

.bbb-pdf-status.is-info {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.bbb-pdf-status.is-warning {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #9a3412;
}

.bbb-pdf-page-wrap {
    width: 100%;
    max-width: 100%;
    margin: 0 auto 14px;
    padding: 8px;
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid #dbe7f5;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.bbb-pdf-page-label {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    margin-bottom: 8px;
    color: #475569;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .02em;
}

.bbb-pdf-page-wrap canvas {
    display: block;
    width: 100% !important;
    height: auto !important;
    max-width: 100%;
    border-radius: 8px;
    background: #ffffff;
}

.bbb-pdf-load-more {
    appearance: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 44px;
    margin: 10px 0 2px;
    padding: 10px 14px;
    border-radius: 14px;
    border: 1px solid #0f7a3b;
    background: #0f7a3b;
    color: #ffffff !important;
    font-size: 14px;
    font-weight: 900;
    text-decoration: none !important;
}

.bbb-pdf-load-more:disabled {
    opacity: .65;
    cursor: wait;
}

.bbb-pdf-fallback-frame[hidden] {
    display: none !important;
}

.bbb-pdf-fallback-frame:not([hidden]) {
    display: block;
    width: 100%;
    height: min(var(--bbb-reader-height, 720px), 82vh);
    min-height: 520px;
    border: 0;
    background: #ffffff;
}

@media (max-width: 768px) {
    .bbb-pdf-js-viewer {
        min-height: 70vh;
        padding: 8px;
    }

    .bbb-pdf-page-wrap {
        padding: 6px;
        margin-bottom: 12px;
        border-radius: 12px;
    }

    .bbb-pdf-page-label {
        min-height: 24px;
        font-size: 11px;
    }

    .bbb-pdf-fallback-frame:not([hidden]) {
        min-height: 70vh;
        height: 70vh;
    }
}

/* v1.8.0 high quality reader + stronger mobile fixes */
.bbb-pdf-js-viewer {
    overflow-x: auto;
    background: #eef3f9;
}

.bbb-pdf-inner-toolbar {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
    padding: 10px;
    border: 1px solid #d7e4f3;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.06);
}

.bbb-pdf-inner-toolbar span {
    color: #334155;
    font-size: 13px;
    font-weight: 800;
}

.bbb-pdf-inner-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.bbb-pdf-inner-actions button {
    appearance: none;
    cursor: pointer;
    min-height: 34px;
    padding: 6px 10px;
    border-radius: 10px;
    border: 1px solid #cfe5ff;
    background: #eef6ff;
    color: #0756a6;
    font-size: 12px;
    font-weight: 900;
}

.bbb-pdf-page-wrap {
    overflow: auto;
}

.bbb-pdf-page-wrap canvas {
    image-rendering: auto;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 1200px), (max-device-width: 1200px) {
    .bbb-book-box {
        width: 100% !important;
        max-width: 100% !important;
    }

    .bbb-chapter-table,
    .bbb-chapter-table thead,
    .bbb-chapter-table tbody,
    .bbb-chapter-table th,
    .bbb-chapter-table td,
    .bbb-chapter-table tr {
        display: block !important;
        width: 100% !important;
    }

    .bbb-chapter-table thead {
        display: none !important;
    }

    .bbb-chapter-table tbody {
        display: grid !important;
        gap: 12px;
    }

    .bbb-chapter-table tr {
        background: #ffffff;
        border: 1px solid #e1e8f0;
        border-radius: 16px;
        padding: 12px;
        overflow: hidden;
    }

    .bbb-chapter-table tr.bbb-reader-table-row {
        padding: 0;
        border-radius: 16px;
    }

    .bbb-chapter-table td {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        border-bottom: 1px solid #eef2f6;
        padding: 10px 0 !important;
    }

    .bbb-chapter-table td:before {
        content: attr(data-label);
        flex: 0 0 125px;
        color: #64748b;
        font-size: 13px;
        font-weight: 900;
    }

    .bbb-reader-table-row td {
        display: block !important;
        padding: 0 !important;
    }

    .bbb-reader-table-row td:before {
        display: none !important;
        content: none !important;
    }
}

@media (max-width: 640px), (max-device-width: 640px) {
    .bbb-pdf-inner-toolbar {
        position: relative;
        flex-direction: column;
        align-items: stretch;
    }

    .bbb-pdf-inner-actions {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        width: 100%;
    }

    .bbb-pdf-inner-actions button {
        width: 100%;
    }

    .bbb-chapter-table td {
        flex-direction: column;
        align-items: stretch;
    }

    .bbb-chapter-table td:before {
        flex: 0 0 auto;
    }
}

/* v1.9.0 full-width reader + working zoom */
.bbb-book-box .bbb-reader-box,
.bbb-book-box .bbb-pdf-frame-wrap {
    width: 100% !important;
    max-width: 100% !important;
}

.bbb-book-box .bbb-reader-box.is-open {
    border-radius: 12px !important;
}

.bbb-book-box .bbb-pdf-frame-wrap {
    background: #ffffff !important;
}

.bbb-book-box .bbb-pdf-js-viewer {
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: auto !important;
    background: #ffffff !important;
}

.bbb-book-box .bbb-pdf-inner-toolbar {
    position: sticky;
    top: 0;
    z-index: 5;
    margin: 0 !important;
    padding: 8px !important;
    border-width: 0 0 1px 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: #ffffff !important;
}

.bbb-book-box .bbb-pdf-inner-toolbar span {
    font-size: 12px !important;
}

.bbb-book-box .bbb-pdf-inner-actions button {
    min-height: 34px !important;
    padding: 6px 9px !important;
}

.bbb-book-box .bbb-pdf-page-wrap {
    max-width: none !important;
    min-width: 0 !important;
    margin: 0 auto 10px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: #ffffff !important;
    overflow: visible !important;
}

.bbb-book-box .bbb-pdf-page-label {
    min-height: 30px !important;
    margin: 0 !important;
    background: #f8fbff !important;
    border-bottom: 1px solid #e5edf7 !important;
    font-size: 13px !important;
}

.bbb-book-box .bbb-pdf-page-wrap canvas {
    display: block !important;
    max-width: none !important;
    margin: 0 auto !important;
    border-radius: 0 !important;
    background: #ffffff !important;
}

.bbb-book-box .bbb-reader-toolbar {
    padding: 8px !important;
    border-bottom: 1px solid #e5edf7 !important;
}

.bbb-book-box .bbb-reader-toolbar strong {
    font-size: 13px !important;
}

@media (max-width: 768px), (max-device-width: 768px) {
    .bbb-book-box {
        overflow: visible !important;
    }

    .bbb-book-box .bbb-section-card {
        overflow: visible !important;
    }

    .bbb-book-box .bbb-reader-box,
    .bbb-book-box .bbb-pdf-frame-wrap,
    .bbb-book-box .bbb-pdf-js-viewer {
        border-radius: 0 !important;
        border-left: 0 !important;
        border-right: 0 !important;
        box-shadow: none !important;
    }

    .bbb-book-box .bbb-reader-toolbar {
        display: none !important;
    }

    .bbb-book-box .bbb-pdf-inner-toolbar {
        gap: 6px !important;
        padding: 7px !important;
    }

    .bbb-book-box .bbb-pdf-inner-actions {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 5px !important;
    }

    .bbb-book-box .bbb-pdf-inner-actions button {
        min-height: 32px !important;
        padding: 5px 6px !important;
        font-size: 11px !important;
        border-radius: 8px !important;
    }

    .bbb-book-box .bbb-pdf-page-wrap {
        margin-bottom: 8px !important;
    }

    .bbb-book-box .bbb-pdf-page-label {
        min-height: 26px !important;
        font-size: 12px !important;
    }

    .bbb-book-box .bbb-reader-table-row td {
        padding: 0 !important;
    }
}

.bbb-book-box .bbb-reader-compact {
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
}

.bbb-book-box .bbb-reader-compact .bbb-pdf-frame-wrap {
    border-top: 0 !important;
}

/* v2.0.0 full-screen reader window */
html.bbb-reader-modal-open,
body.bbb-reader-modal-open {
    overflow: hidden !important;
    height: 100% !important;
}

.bbb-reader-modal {
    position: fixed !important;
    inset: 0 !important;
    z-index: 2147483000 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: #0f172a !important;
    color: #172033 !important;
}

.bbb-reader-modal[hidden] {
    display: none !important;
}

.bbb-reader-modal.is-open {
    display: block !important;
}

.bbb-reader-modal,
.bbb-reader-modal * {
    box-sizing: border-box !important;
}

.bbb-reader-modal-panel {
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    background: #f3f7fb !important;
}

.bbb-reader-modal-bar {
    flex: 0 0 auto !important;
    min-height: 56px !important;
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) auto !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 8px 10px !important;
    background: #ffffff !important;
    border-bottom: 1px solid #dbe7f5 !important;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08) !important;
}

.bbb-reader-modal-title {
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    text-align: center !important;
    color: #172033 !important;
    font-size: 15px !important;
    font-weight: 900 !important;
    line-height: 1.25 !important;
}

.bbb-reader-modal-close,
.bbb-reader-modal-open {
    min-height: 40px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 8px 12px !important;
    border-radius: 12px !important;
    font-size: 13px !important;
    font-weight: 900 !important;
    text-decoration: none !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
}

.bbb-reader-modal-close {
    appearance: none !important;
    border: 1px solid #fecaca !important;
    background: #fef2f2 !important;
    color: #991b1b !important;
    cursor: pointer !important;
}

.bbb-reader-modal-open {
    border: 1px solid #cfe5ff !important;
    background: #eef6ff !important;
    color: #0756a6 !important;
}

.bbb-reader-modal-body {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    width: 100% !important;
    overflow: hidden !important;
    background: #eaf0f7 !important;
}

.bbb-reader-modal .bbb-pdf-js-viewer {
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    padding: 0 !important;
    overflow: auto !important;
    background: #eaf0f7 !important;
    -webkit-overflow-scrolling: touch !important;
}

.bbb-reader-modal .bbb-pdf-inner-toolbar {
    position: sticky !important;
    top: 0 !important;
    z-index: 5 !important;
    margin: 0 !important;
    padding: 8px 10px !important;
    border-width: 0 0 1px 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: #ffffff !important;
}

.bbb-reader-modal .bbb-pdf-inner-toolbar span {
    color: #334155 !important;
    font-size: 13px !important;
    font-weight: 900 !important;
}

.bbb-reader-modal .bbb-pdf-inner-actions {
    display: flex !important;
    gap: 6px !important;
    align-items: center !important;
    justify-content: flex-end !important;
    flex-wrap: wrap !important;
}

.bbb-reader-modal .bbb-pdf-inner-actions button {
    min-height: 34px !important;
    padding: 6px 10px !important;
    border-radius: 10px !important;
    border: 1px solid #cfe5ff !important;
    background: #eef6ff !important;
    color: #0756a6 !important;
    font-size: 12px !important;
    font-weight: 900 !important;
    cursor: pointer !important;
}

.bbb-reader-modal .bbb-pdf-page-wrap {
    max-width: none !important;
    min-width: 0 !important;
    margin: 0 auto 10px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: #ffffff !important;
    overflow: visible !important;
}

.bbb-reader-modal .bbb-pdf-page-label {
    min-height: 30px !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #f8fbff !important;
    border-bottom: 1px solid #e5edf7 !important;
    color: #475569 !important;
    font-size: 13px !important;
    font-weight: 900 !important;
}

.bbb-reader-modal .bbb-pdf-page-wrap canvas {
    display: block !important;
    max-width: none !important;
    margin: 0 auto !important;
    border-radius: 0 !important;
    background: #ffffff !important;
}

.bbb-reader-modal .bbb-pdf-status,
.bbb-reader-modal .bbb-pdf-placeholder {
    margin: 12px !important;
    border-radius: 14px !important;
}

.bbb-reader-modal .bbb-pdf-load-more {
    width: calc(100% - 20px) !important;
    max-width: 680px !important;
    margin: 12px auto 18px !important;
}

.bbb-reader-modal .bbb-pdf-fallback-frame:not([hidden]) {
    display: block !important;
    width: 100% !important;
    height: calc(100vh - 56px) !important;
    min-height: 0 !important;
    border: 0 !important;
    background: #ffffff !important;
}

@media (max-width: 640px), (max-device-width: 640px) {
    .bbb-reader-modal-bar {
        min-height: 54px !important;
        grid-template-columns: auto minmax(0, 1fr) auto !important;
        gap: 6px !important;
        padding: 7px !important;
    }

    .bbb-reader-modal-close,
    .bbb-reader-modal-open {
        min-height: 38px !important;
        padding: 7px 9px !important;
        border-radius: 10px !important;
        font-size: 12px !important;
    }

    .bbb-reader-modal-title {
        font-size: 13px !important;
    }

    .bbb-reader-modal .bbb-pdf-inner-toolbar {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 6px !important;
        padding: 7px !important;
    }

    .bbb-reader-modal .bbb-pdf-inner-toolbar span {
        text-align: center !important;
        font-size: 12px !important;
    }

    .bbb-reader-modal .bbb-pdf-inner-actions {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        width: 100% !important;
        gap: 5px !important;
    }

    .bbb-reader-modal .bbb-pdf-inner-actions button {
        width: 100% !important;
        min-height: 34px !important;
        padding: 5px !important;
        font-size: 11px !important;
    }

    .bbb-reader-modal .bbb-pdf-page-label {
        min-height: 26px !important;
        font-size: 12px !important;
    }
}

/* v2.1.0 reader UX, chapter navigation, SEO link cards */
.bbb-auto-link-grid,
.bbb-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.bbb-auto-link-grid a,
.bbb-related-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px;
    border: 1px solid #dbe7f5;
    border-radius: 14px;
    background: #ffffff;
    color: #0f4d83 !important;
    text-decoration: none !important;
    font-weight: 900;
    line-height: 1.35;
}

.bbb-related-card span {
    color: #64748b !important;
    font-size: 12px;
    font-weight: 800;
}

.bbb-virtual-chapter-page {
    width: min(1100px, calc(100% - 28px));
    margin: 24px auto;
}

.bbb-virtual-chapter-hero {
    padding: 22px;
    border: 1px solid #dbe7f5;
    border-radius: 22px;
    background: linear-gradient(135deg, #f8fbff 0%, #eef6ff 100%);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
    margin-bottom: 18px;
}

.bbb-virtual-chapter-hero h1 {
    margin: 8px 0 10px !important;
    color: #172033 !important;
    font-size: clamp(26px, 4vw, 44px) !important;
    line-height: 1.15 !important;
}

.bbb-virtual-chapter-hero p {
    color: #475569;
    font-size: 16px;
    line-height: 1.6;
    margin: 0 0 16px;
}

.bbb-crumbs {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    color: #64748b;
    font-size: 13px;
    font-weight: 800;
}

.bbb-crumbs a {
    color: #0756a6 !important;
    text-decoration: none !important;
}

.bbb-virtual-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.bbb-important-questions ol {
    margin: 0;
    padding-left: 20px;
}

.bbb-important-questions li {
    margin: 7px 0;
    color: #334155;
}

.bbb-reader-progress-bar {
    width: 100% !important;
    height: 4px !important;
    background: #dbe7f5 !important;
}

.bbb-reader-progress-bar span {
    display: block !important;
    width: 0;
    height: 100% !important;
    background: #0f7a3b !important;
    transition: width .2s ease;
}

.bbb-reader-modal-tools {
    flex: 0 0 auto !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1.15fr) minmax(220px, .85fr) auto !important;
    gap: 8px !important;
    padding: 8px 10px !important;
    background: #ffffff !important;
    border-bottom: 1px solid #dbe7f5 !important;
}

.bbb-reader-tools-row {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    min-width: 0 !important;
}

.bbb-reader-modal-tools button,
.bbb-reader-modal-tools input {
    min-height: 36px !important;
    border-radius: 10px !important;
    border: 1px solid #cfe5ff !important;
    font-size: 12px !important;
    font-weight: 900 !important;
}

.bbb-reader-modal-tools button {
    cursor: pointer !important;
    background: #eef6ff !important;
    color: #0756a6 !important;
    padding: 6px 10px !important;
}

.bbb-reader-modal-tools button:disabled {
    opacity: .45 !important;
    cursor: not-allowed !important;
}

.bbb-reader-page-label {
    flex: 0 0 auto !important;
    color: #172033 !important;
    font-size: 12px !important;
    font-weight: 900 !important;
    white-space: nowrap !important;
}

.bbb-reader-page-tools label {
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    color: #475569 !important;
    font-size: 12px !important;
    font-weight: 900 !important;
    white-space: nowrap !important;
}

.bbb-reader-page-input {
    width: 70px !important;
    padding: 4px 8px !important;
    text-align: center !important;
    color: #172033 !important;
    background: #ffffff !important;
}

.bbb-reader-search-input {
    flex: 1 1 auto !important;
    min-width: 110px !important;
    padding: 4px 10px !important;
    background: #ffffff !important;
    color: #172033 !important;
}

.bbb-reader-search-status {
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    color: #64748b !important;
    font-size: 12px !important;
    font-weight: 800 !important;
}

.bbb-reader-continue {
    background: #0f7a3b !important;
    color: #ffffff !important;
    border-color: #0f7a3b !important;
}

.bbb-reader-modal-body {
    display: grid !important;
    grid-template-columns: 220px minmax(0, 1fr) !important;
    overflow: hidden !important;
}

.bbb-reader-chapter-nav {
    width: 220px !important;
    height: 100% !important;
    overflow: auto !important;
    padding: 10px !important;
    background: #ffffff !important;
    border-right: 1px solid #dbe7f5 !important;
}

.bbb-reader-chapter-nav[hidden] {
    display: none !important;
}

.bbb-reader-modal-body:has(.bbb-reader-chapter-nav[hidden]) {
    grid-template-columns: minmax(0, 1fr) !important;
}

.bbb-reader-chapter-nav strong {
    display: block !important;
    margin: 0 0 8px !important;
    color: #172033 !important;
    font-size: 13px !important;
    font-weight: 900 !important;
}

.bbb-reader-chapter-nav button {
    appearance: none !important;
    display: block !important;
    width: 100% !important;
    min-height: 38px !important;
    margin-bottom: 7px !important;
    padding: 8px 10px !important;
    border: 1px solid #dbe7f5 !important;
    border-radius: 10px !important;
    background: #f8fbff !important;
    color: #334155 !important;
    text-align: left !important;
    font-size: 12px !important;
    font-weight: 900 !important;
    cursor: pointer !important;
}

.bbb-reader-chapter-nav button.is-active {
    background: #0f7a3b !important;
    color: #ffffff !important;
    border-color: #0f7a3b !important;
}

.bbb-reader-modal .bbb-pdf-js-viewer {
    grid-column: auto !important;
}

.bbb-reader-modal .bbb-pdf-fallback-frame:not([hidden]) {
    grid-column: 1 / -1 !important;
}

@media (max-width: 980px), (max-device-width: 980px) {
    .bbb-reader-modal-tools {
        grid-template-columns: 1fr !important;
        gap: 6px !important;
    }

    .bbb-reader-search-tools,
    .bbb-reader-page-tools,
    .bbb-reader-zoom-tools {
        justify-content: center !important;
        flex-wrap: wrap !important;
    }

    .bbb-reader-modal-body {
        grid-template-columns: 1fr !important;
        grid-template-rows: auto minmax(0, 1fr) !important;
    }

    .bbb-reader-chapter-nav {
        width: 100% !important;
        height: auto !important;
        max-height: 96px !important;
        border-right: 0 !important;
        border-bottom: 1px solid #dbe7f5 !important;
        white-space: nowrap !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
    }

    .bbb-reader-chapter-nav strong,
    .bbb-reader-chapter-nav button {
        display: inline-flex !important;
        vertical-align: middle !important;
        width: auto !important;
        margin: 0 6px 0 0 !important;
        white-space: nowrap !important;
    }
}

@media (max-width: 640px), (max-device-width: 640px) {
    .bbb-reader-modal-bar {
        min-height: 48px !important;
        padding: 5px !important;
        gap: 5px !important;
    }

    .bbb-reader-modal-close,
    .bbb-reader-modal-open {
        min-height: 34px !important;
        padding: 6px 8px !important;
        font-size: 11px !important;
        border-radius: 9px !important;
    }

    .bbb-reader-modal-title {
        font-size: 12px !important;
    }

    .bbb-reader-modal-tools {
        padding: 5px !important;
    }

    .bbb-reader-page-tools {
        display: grid !important;
        grid-template-columns: auto auto minmax(0, 1fr) auto !important;
        width: 100% !important;
    }

    .bbb-reader-page-label {
        display: none !important;
    }

    .bbb-reader-page-tools label {
        justify-content: center !important;
        min-width: 0 !important;
    }

    .bbb-reader-page-input {
        width: 58px !important;
    }

    .bbb-reader-search-tools {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto !important;
        width: 100% !important;
    }

    .bbb-reader-search-status {
        grid-column: 1 / -1 !important;
        text-align: center !important;
    }

    .bbb-reader-zoom-tools {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        width: 100% !important;
    }

    .bbb-reader-modal-tools button,
    .bbb-reader-modal-tools input {
        min-height: 32px !important;
        font-size: 11px !important;
        padding: 4px 6px !important;
    }

    .bbb-reader-chapter-nav {
        max-height: 58px !important;
        padding: 6px !important;
    }

    .bbb-reader-chapter-nav button,
    .bbb-reader-chapter-nav strong {
        min-height: 32px !important;
        padding: 6px 8px !important;
        font-size: 11px !important;
    }

    .bbb-virtual-actions .bbb-reader-btn,
    .bbb-virtual-actions .bbb-download-btn {
        width: 100% !important;
    }
}

/* v2.1.0 no-:has fallback for reader columns */
.bbb-reader-modal-body {
    grid-template-columns: minmax(0, 1fr) !important;
}
.bbb-reader-modal-body.has-chapters {
    grid-template-columns: 220px minmax(0, 1fr) !important;
}
@media (max-width: 980px), (max-device-width: 980px) {
    .bbb-reader-modal-body.has-chapters {
        grid-template-columns: 1fr !important;
        grid-template-rows: auto minmax(0, 1fr) !important;
    }
}
