/* ═══════════════════════════════════════════
   Chess Book Reader — Compact Styles
   ═══════════════════════════════════════════ */

/* Fullscreen overlay */
.cb-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: linear-gradient(135deg, #0f0f1a 0%, #1a1a2e 50%, #16213e 100%);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: cbFadeIn 0.2s ease;
}

@keyframes cbFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Header bar — compact */
.cb-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 10px;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
    gap: 6px;
    height: 36px;
}

.cb-header-title {
    font-weight: 700;
    color: #f1c40f;
    font-size: 0.8rem;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.cb-header-btn {
    background: rgba(255,255,255,0.1);
    border: none;
    color: #fff;
    font-size: 0.72rem;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 600;
    transition: background 0.2s;
    white-space: nowrap;
}
.cb-header-btn:hover { background: rgba(255,255,255,0.2); }
.cb-header-btn--primary {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
}
.cb-header-btn--primary:hover { background: linear-gradient(135deg, #059669, #047857); }
.cb-header-btn--primary:disabled {
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.4);
    cursor: not-allowed;
}

/* Main 3-panel layout */
.cb-body {
    flex: 1;
    display: flex;
    overflow: hidden;
    gap: 0;
}

/* Panel tabs (mobile) */
.cb-panel-tabs {
    display: none;
    flex-shrink: 0;
    background: rgba(0,0,0,0.4);
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.cb-panel-tabs-inner { display: flex; gap: 0; }

.cb-panel-tab {
    flex: 1;
    padding: 7px 6px;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    background: none;
    border-top: none; border-left: none; border-right: none;
}
.cb-panel-tab.active {
    color: #f1c40f;
    border-bottom-color: #f1c40f;
}

/* Individual panels */
.cb-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-right: 1px solid rgba(255,255,255,0.06);
}
.cb-panel:last-child { border-right: none; }

.cb-panel--board { width: 35%; min-width: 300px; }
.cb-panel--pdf { width: 45%; min-width: 300px; }
.cb-panel--dict { width: 20%; min-width: 200px; transition: width 0.3s ease, min-width 0.3s ease, opacity 0.3s ease; }
.cb-panel--dict.collapsed { width: 0; min-width: 0; overflow: hidden; opacity: 0; padding: 0; border: none; }
.cb-body.dict-hidden .cb-panel--board { width: 38%; }
.cb-body.dict-hidden .cb-panel--pdf { width: 62%; }

/* Panel headers — ultra compact */
.cb-panel-header {
    padding: 2px 6px;
    background: rgba(255,255,255,0.04);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    height: 24px;
}
.cb-panel-header-icon { font-size: 0.75rem; }
.cb-panel-header-title {
    font-weight: 700;
    color: #e0e0e0;
    font-size: 0.7rem;
}

.cb-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 3px 4px;
}

/* ═══ Board Panel — compact ═══ */
.cb-board-wrapper {
    width: 100%;
    aspect-ratio: 1/1;
    max-width: 420px;
    margin: 0 auto;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.4);
    border: 2px solid #8b6914;
}

.cb-board-wrapper cg-board {
    width: 100% !important;
    height: 100% !important;
}

/* Move controls — inline compact */
.cb-move-controls {
    display: flex;
    justify-content: center;
    gap: 3px;
    margin-top: 4px;
}

.cb-move-btn {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    color: #fff;
    width: 28px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    padding: 0;
}
.cb-move-btn:hover { background: rgba(255,255,255,0.18); }

/* Moves list — compact, scrollable */
.cb-moves-list {
    margin-top: 4px;
    background: rgba(0,0,0,0.3);
    border-radius: 6px;
    padding: 4px 6px;
    min-height: 36px;
    max-height: 80px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.72rem;
    color: #ccc;
    line-height: 1.5;
}

.cb-move-num {
    color: rgba(255,255,255,0.4);
    margin-right: 2px;
}
.cb-move-item {
    display: inline;
    cursor: pointer;
    padding: 0px 2px;
    border-radius: 2px;
    transition: background 0.15s;
}
.cb-move-item:hover { background: rgba(255,255,255,0.15); }
.cb-move-item.active { background: rgba(241,196,15,0.3); color: #f1c40f; }

/* Input rows — compact */
.cb-input-row {
    display: flex;
    gap: 4px;
    margin-top: 3px;
}

.cb-input {
    flex: 1;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    color: #fff;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    outline: none;
}
.cb-input:focus { border-color: #f1c40f; }
.cb-input::placeholder { color: rgba(255,255,255,0.25); }

.cb-small-btn {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    color: #ccc;
    padding: 2px 7px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.68rem;
    font-weight: 600;
    transition: background 0.15s;
    white-space: nowrap;
}
.cb-small-btn:hover { background: rgba(255,255,255,0.18); color: #fff; }

/* FEN/Lichess action bar */
.cb-action-bar {
    display: flex;
    gap: 3px;
    margin-top: 3px;
    flex-wrap: wrap;
}
.cb-action-btn {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.6);
    padding: 2px 6px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.62rem;
    font-weight: 600;
    transition: all 0.15s;
    white-space: nowrap;
}
.cb-action-btn:hover { background: rgba(255,255,255,0.15); color: #fff; }
.cb-action-btn--lichess { color: #e0e0e0; }
.cb-action-btn--lichess:hover { background: rgba(255,255,255,0.2); }

/* Board Editor Piece Palette */
.cb-piece-palette {
    background: rgba(0,0,0,0.25);
    border-radius: 5px;
    padding: 4px;
    margin-top: 3px;
}
.cb-palette-row {
    display: flex;
    justify-content: center;
    gap: 2px;
    margin-bottom: 2px;
}
.cb-palette-row:last-child { margin-bottom: 0; }
.cb-palette-piece {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    color: #e0e0e0;
    width: 32px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    padding: 0;
}
.cb-palette-piece:hover { background: rgba(255,255,255,0.15); border-color: rgba(255,255,255,0.25); }
.cb-palette-piece.active { 
    background: rgba(241,196,15,0.25); 
    border-color: #f1c40f; 
    color: #f1c40f;
    box-shadow: 0 0 6px rgba(241,196,15,0.3);
}
.cb-palette-piece:nth-child(n+2):last-child,
.cb-palette-row:last-child .cb-palette-piece:nth-child(2),
.cb-palette-row:last-child .cb-palette-piece:nth-child(3) {
    width: auto;
    padding: 0 8px;
    font-size: 0.62rem;
    font-weight: 600;
}

/* ═══ PDF Panel — maximize height ═══ */
.cb-panel--pdf .cb-panel-content {
    padding: 2px 4px;
    display: flex;
    flex-direction: column;
}

.cb-pdf-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 2px 0;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.cb-pdf-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 2px 0;
    flex-shrink: 0;
}

.cb-pdf-canvas-wrapper {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(0,0,0,0.15);
    border-radius: 4px;
    min-height: 100px;
    position: relative;
}

.cb-pdf-canvas-wrapper canvas {
    max-width: 100%;
    height: auto;
}

/* PDF Text Layer — transparent selectable text overlay */
.cb-pdf-textlayer {
    position: absolute;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
    overflow: hidden;
    opacity: 0.25;
    line-height: 1.0;
    pointer-events: auto;
    z-index: 2;
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
}
.cb-pdf-textlayer > span {
    color: transparent;
    position: absolute;
    white-space: pre;
    transform-origin: 0% 0%;
    cursor: text;
    pointer-events: all;
    user-select: text;
}
.cb-pdf-textlayer > span::selection {
    background: rgba(0, 100, 255, 0.4);
    color: transparent;
}
.cb-pdf-textlayer > span::-moz-selection {
    background: rgba(0, 100, 255, 0.4);
    color: transparent;
}
.cb-pdf-canvas-wrapper canvas {
    position: relative;
    z-index: 1;
}

/* Text selection popup */
.cb-text-popup {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15,15,26,0.95);
    border: 1px solid rgba(241,196,15,0.4);
    border-radius: 10px;
    padding: 6px 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 10002;
    box-shadow: 0 4px 20px rgba(0,0,0,0.6);
    animation: cbFadeIn 0.2s ease;
    max-width: 90vw;
}
.cb-text-popup-text {
    color: #e0e0e0;
    font-size: 0.72rem;
    font-style: italic;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cb-text-popup-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    color: #f1c40f;
    padding: 3px 8px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.68rem;
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.15s;
}
.cb-text-popup-btn:hover { background: rgba(255,255,255,0.2); }
.cb-text-popup-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.4);
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0 2px;
}
.cb-text-popup-close:hover { color: #fff; }

.cb-pdf-zoom {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 1px 0;
    justify-content: center;
}

.cb-pdf-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.3);
    gap: 8px;
    text-align: center;
    padding: 20px 10px;
}
.cb-pdf-empty-icon { font-size: 2.5rem; }

/* Book selector cards */
.cb-book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
    padding: 6px 0;
}
.cb-book-card {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 10px 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}
.cb-book-card:hover {
    background: rgba(255,255,255,0.12);
    border-color: #f1c40f;
    transform: translateY(-2px);
}
.cb-book-card-icon { font-size: 1.6rem; margin-bottom: 4px; }
.cb-book-card-title { font-size: 0.7rem; font-weight: 600; color: #e0e0e0; line-height: 1.3; }
.cb-book-card-author { font-size: 0.6rem; color: rgba(255,255,255,0.4); margin-top: 2px; }

/* ═══ Dictionary Panel ═══ */
.cb-dict-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 6px;
    background: rgba(0,0,0,0.2);
    border-radius: 6px;
    overflow: hidden;
}

.cb-dict-tab {
    flex: 1;
    padding: 5px 4px;
    text-align: center;
    font-size: 0.68rem;
    font-weight: 600;
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: all 0.2s;
    background: none;
    border: none;
}
.cb-dict-tab.active {
    color: #f1c40f;
    background: rgba(241,196,15,0.15);
}

.cb-dict-search {
    display: flex;
    gap: 4px;
    margin-bottom: 6px;
}

.cb-dict-result {
    background: rgba(255,255,255,0.06);
    border-radius: 6px;
    padding: 8px;
    margin-bottom: 6px;
}
.cb-dict-result-word {
    font-weight: 700;
    color: #f1c40f;
    font-size: 0.9rem;
    margin-bottom: 2px;
}
.cb-dict-result-translation {
    color: #e0e0e0;
    font-size: 0.82rem;
}
.cb-dict-result-actions {
    margin-top: 6px;
    display: flex;
    gap: 4px;
}

/* Vocabulary list */
.cb-vocab-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    background: rgba(255,255,255,0.04);
    border-radius: 6px;
    margin-bottom: 4px;
    transition: background 0.15s;
}
.cb-vocab-item:hover { background: rgba(255,255,255,0.08); }

.cb-vocab-word { font-weight: 600; color: #e0e0e0; font-size: 0.78rem; min-width: 60px; }
.cb-vocab-trans { flex: 1; color: rgba(255,255,255,0.6); font-size: 0.72rem; }

.cb-vocab-status {
    font-size: 0.58rem;
    padding: 1px 5px;
    border-radius: 3px;
    font-weight: 600;
}
.cb-vocab-status--new { background: rgba(59,130,246,0.2); color: #60a5fa; }
.cb-vocab-status--learning { background: rgba(245,158,11,0.2); color: #fbbf24; }
.cb-vocab-status--mastered { background: rgba(16,185,129,0.2); color: #34d399; }

.cb-vocab-del {
    background: none; border: none;
    color: rgba(255,255,255,0.3);
    cursor: pointer; font-size: 0.8rem;
    padding: 1px; transition: color 0.15s;
}
.cb-vocab-del:hover { color: #ef4444; }

/* Preset terms */
.cb-preset-grid { display: flex; flex-direction: column; gap: 4px; }
.cb-preset-item {
    display: flex; align-items: center; gap: 6px;
    padding: 5px 6px; background: rgba(255,255,255,0.04);
    border-radius: 4px; cursor: pointer; transition: background 0.15s;
}
.cb-preset-item:hover { background: rgba(255,255,255,0.08); }
.cb-preset-cat {
    font-size: 0.55rem; padding: 1px 4px; border-radius: 3px;
    font-weight: 700; text-transform: uppercase; white-space: nowrap;
}
.cb-preset-cat--piece { background: rgba(168,85,247,0.2); color: #c084fc; }
.cb-preset-cat--general { background: rgba(59,130,246,0.2); color: #60a5fa; }
.cb-preset-cat--tactic { background: rgba(239,68,68,0.2); color: #f87171; }
.cb-preset-cat--opening { background: rgba(34,197,94,0.2); color: #4ade80; }
.cb-preset-cat--middlegame { background: rgba(245,158,11,0.2); color: #fbbf24; }
.cb-preset-cat--endgame { background: rgba(20,184,166,0.2); color: #2dd4bf; }

.cb-preset-word { font-weight: 600; color: #e0e0e0; font-size: 0.72rem; min-width: 60px; }
.cb-preset-trans { flex: 1; color: rgba(255,255,255,0.5); font-size: 0.68rem; }
.cb-preset-add {
    background: rgba(16,185,129,0.2); border: none; color: #34d399;
    font-size: 0.65rem; padding: 2px 6px; border-radius: 3px;
    cursor: pointer; font-weight: 600; transition: background 0.15s; white-space: nowrap;
}
.cb-preset-add:hover { background: rgba(16,185,129,0.3); }

/* ═══ Verification bar — minimal ═══ */
.cb-verify-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 12px;
    background: rgba(0,0,0,0.4);
    border-top: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
    flex-wrap: wrap;
    justify-content: center;
    height: 24px;
}

.cb-verify-item {
    display: flex; align-items: center; gap: 3px;
    font-size: 0.62rem; color: rgba(255,255,255,0.5); font-weight: 600;
}
.cb-verify-icon { font-size: 0.72rem; }
.cb-verify-item.passed .cb-verify-icon { color: #34d399; }
.cb-verify-item.passed { color: #34d399; }

/* Quiz modal */
.cb-quiz-modal {
    position: fixed; inset: 0; z-index: 10001;
    background: rgba(0,0,0,0.7);
    display: flex; align-items: center; justify-content: center;
    animation: cbFadeIn 0.2s ease;
}
.cb-quiz-card {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border: 1px solid rgba(241,196,15,0.3);
    border-radius: 14px; padding: 24px 20px;
    max-width: 360px; width: 88%; text-align: center;
}
.cb-quiz-title { font-size: 0.95rem; font-weight: 700; color: #f1c40f; margin-bottom: 14px; }
.cb-quiz-word {
    font-size: 1.3rem; font-weight: 700; color: #fff; margin-bottom: 14px;
    padding: 10px; background: rgba(255,255,255,0.08); border-radius: 8px;
}
.cb-quiz-input {
    width: 100%; padding: 8px 12px; border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.2); background: rgba(255,255,255,0.08);
    color: #fff; font-size: 0.95rem; text-align: center; outline: none;
    margin-bottom: 10px; box-sizing: border-box;
}
.cb-quiz-input:focus { border-color: #f1c40f; }
.cb-quiz-result { margin-bottom: 10px; font-weight: 600; font-size: 0.85rem; }
.cb-quiz-btns { display: flex; gap: 8px; justify-content: center; }

/* ═══ Continuous PDF Scroll ═══ */
.cb-pdf-page-container {
    position: relative;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding-bottom: 8px;
}
.cb-pdf-page-container:last-child { margin-bottom: 0; border-bottom: none; }
.cb-pdf-page-label {
    text-align: center;
    font-size: 0.65rem;
    color: rgba(255,255,255,0.35);
    padding: 2px 0;
    font-weight: 600;
}
.cb-pdf-page-canvas {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}
.cb-pdf-page-container .cb-pdf-textlayer {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    overflow: hidden;
    opacity: 0.25;
    line-height: 1.0;
    pointer-events: auto;
    z-index: 2;
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
}

/* Palette labels */
.cb-palette-label {
    font-size: 0.6rem;
    color: rgba(255,255,255,0.4);
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 4px 1px;
    letter-spacing: 0.5px;
}
.cb-palette-utils { margin-top: 2px; }
.cb-palette-play {
    width: auto !important;
    padding: 0 10px !important;
    font-size: 0.65rem !important;
    font-weight: 700 !important;
    background: rgba(16,185,129,0.2) !important;
    color: #34d399 !important;
    border-color: rgba(16,185,129,0.3) !important;
}
.cb-palette-play:hover {
    background: rgba(16,185,129,0.35) !important;
}

/* Piece colors in palette */
.cb-piece-white { color: #f0f0f0 !important; text-shadow: 0 0 3px rgba(0,0,0,0.8), 0 0 1px #000; }
.cb-piece-black { color: #444 !important; text-shadow: 0 0 2px rgba(255,255,255,0.3); }
.cb-piece-white.active { color: #f1c40f !important; }
.cb-piece-black.active { color: #f1c40f !important; }

/* Side-to-move toggle */
.cb-palette-side { gap: 4px; }
.cb-side-btn {
    width: auto !important;
    padding: 2px 10px !important;
    font-size: 0.62rem !important;
    font-weight: 700 !important;
    border-radius: 6px !important;
}
.cb-side-btn.active {
    background: rgba(59,130,246,0.25) !important;
    border-color: rgba(59,130,246,0.5) !important;
    color: #60a5fa !important;
}

/* ═══ Responsive ═══ */
@media (max-width: 900px) {
    .cb-body { flex-direction: column; }
    .cb-panel-tabs { display: block; }
    .cb-panel--board, .cb-panel--pdf, .cb-panel--dict {
        width: 100%; min-width: 0; display: none;
    }
    .cb-panel.active-panel { display: flex; flex: 1; }
}

/* Scrollbar — thin */
.cb-panel-content::-webkit-scrollbar,
.cb-moves-list::-webkit-scrollbar,
.cb-pdf-canvas-wrapper::-webkit-scrollbar { width: 4px; }
.cb-panel-content::-webkit-scrollbar-track,
.cb-moves-list::-webkit-scrollbar-track,
.cb-pdf-canvas-wrapper::-webkit-scrollbar-track { background: transparent; }
.cb-panel-content::-webkit-scrollbar-thumb,
.cb-moves-list::-webkit-scrollbar-thumb,
.cb-pdf-canvas-wrapper::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.12);
    border-radius: 3px;
}

/* ═══ Jump-to-page input ═══ */
.cb-pdf-goto-input {
    width: 48px !important;
    padding: 2px 4px !important;
    font-size: 0.72rem !important;
    text-align: center;
    border-radius: 4px !important;
    margin-left: 4px;
}
.cb-pdf-goto-input::-webkit-inner-spin-button,
.cb-pdf-goto-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.cb-pdf-goto-input { -moz-appearance: textfield; appearance: textfield; }

.cb-pdf-separator {
    color: rgba(255,255,255,0.15);
    font-size: 0.8rem;
    margin: 0 2px;
}

/* ═══ PDF Color Mode ═══ */
.cb-pdf-color-btn {
    font-size: 0.7rem !important;
    padding: 2px 5px !important;
    min-width: unset !important;
    border-radius: 4px !important;
    transition: all 0.15s;
}
.cb-pdf-color-btn.active {
    background: rgba(241,196,15,0.22) !important;
    border-color: rgba(241,196,15,0.4) !important;
    box-shadow: 0 0 4px rgba(241,196,15,0.2);
}

/* Dark mode: invert colors */
.cb-pdf-dark canvas,
.cb-pdf-dark .cb-pdf-page-canvas {
    filter: invert(0.88) hue-rotate(180deg);
}
.cb-pdf-dark .cb-pdf-textlayer > span::selection {
    background: rgba(255, 155, 0, 0.4);
}

/* Sepia mode: warm tint */
.cb-pdf-sepia canvas,
.cb-pdf-sepia .cb-pdf-page-canvas {
    filter: sepia(0.35) brightness(0.95) contrast(1.05);
}

/* ═══ Page label improvements ═══ */
.cb-pdf-page-label {
    font-size: 0.62rem;
    color: rgba(255,255,255,0.25);
    text-align: center;
    padding: 4px 0 2px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.cb-pdf-page-container {
    position: relative;
    margin-bottom: 4px;
}

/* ═══ PDF nav — wrap on small screens ═══ */
.cb-pdf-nav {
    flex-wrap: wrap;
    gap: 3px;
}
