/* ==========================================================================
   SQL MASTER BEGINNER NOTES ALL-IN-ONE 3D BOOK STYLESHEET
   Compact Toolbar, Reduced Book Height, Symbol-Only Controls & Fullscreen
   ========================================================================== */

/* ─── BOOK WRAPPER ────────────────────────────────────────── */
.beginner-book-wrapper {
    display: flex;
    flex-direction: column;
    min-height: auto;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2px 16px 12px;
    box-sizing: border-box;
    position: relative;
    transition: all 0.25s ease;
}

/* ─── SLIM COMPACT TOP TOOLBAR ────────────────────────────── */
.book-toolbar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 3px 12px;
    border-radius: 10px;
    background: rgba(11, 23, 44, 0.85);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(56, 189, 248, 0.16);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.30);
    margin-bottom: 8px;
    gap: 10px;
    z-index: 20;
    height: 40px;
    min-height: 40px;
    box-sizing: border-box;
}

.book-toolbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-self: start;
}

.book-toolbar-center {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-self: center;
}

.book-toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-self: end;
}

/* Symbol-Only Buttons (Back & Fullscreen) */
.btn-book-action.btn-icon-only {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 8px;
    font-size: 0.95rem;
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.10);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-sizing: border-box;
    flex-shrink: 0;
}

.btn-book-action.btn-icon-only:hover {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.15);
    border-color: rgba(56, 189, 248, 0.40);
    transform: translateY(-1px);
}

.btn-fullscreen {
    color: #cbd5e1;
    background: rgba(56, 189, 248, 0.08);
    border-color: rgba(56, 189, 248, 0.25);
}

.btn-fullscreen:hover {
    color: #ffffff;
    background: rgba(56, 189, 248, 0.22);
    border-color: rgba(56, 189, 248, 0.50);
}

/* Chapter Selector Dropdown */
.chapter-selector-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(56, 189, 248, 0.22);
    border-radius: 8px;
    padding: 0 10px 0 8px;
    box-sizing: border-box;
}

.chapter-select-icon {
    color: #38bdf8;
    font-size: 0.82rem;
    flex-shrink: 0;
}

.chapter-select {
    background: transparent;
    color: #f1f5f9;
    border: none;
    outline: none;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    max-width: 190px;
    line-height: 30px;
}

.chapter-select option {
    background: #0b172c;
    color: #f1f5f9;
    padding: 6px 10px;
}

/* Page Navigation Controls (Prev / Next) */
.btn-flip-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: 32px;
    padding: 0 14px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #021a12;
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(16, 185, 129, 0.35);
    transition: all 0.2s ease;
    white-space: nowrap;
    box-sizing: border-box;
}

.btn-flip-nav:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.45);
}

.btn-flip-nav:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.08);
    color: #64748b;
    box-shadow: none;
    transform: none;
}

/* Current Chapter Pill (Content only - No Page Numbers) */
.current-chapter-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    padding: 0 14px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(56, 189, 248, 0.20);
    font-size: 0.78rem;
    font-weight: 700;
    color: #38bdf8;
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-sizing: border-box;
}

/* ─── LIGHTWEIGHT LOADER ─────────────────────────────────── */
.book-loader-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 420px;
    text-align: center;
}

/* ─── 3D BOOK STAGE (COMPACT REDUCED HEIGHT) ─────────────── */
.book-stage {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 4px auto 10px;
    width: 100%;
    min-height: 600px;
    position: relative;
    perspective: 2500px;
}

.sql-beginner-book {
    box-shadow: 0 25px 65px -15px rgba(0, 0, 0, 0.75), 0 0 40px rgba(56, 189, 248, 0.12);
    border-radius: 8px;
    position: relative;
}

/* Base Page Dimensions & Paper Styling */
.sql-note-page {
    background-color: #ffffff;
    box-sizing: border-box;
    overflow: hidden;
    position: relative;
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
}

.sql-beginner-book,
.page-inner,
.page-content-area,
.page-text-body,
.sql-pre,
.sql-code,
.page-sql-block,
.cover-inner,
.toc-inner,
.chapter-divider-inner,
.back-cover-inner {
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
}

/* Realistic 3D Spine and Page Edges */
.sql-note-page.--left {
    border-top-left-radius: 6px;
    border-bottom-left-radius: 6px;
    box-shadow: inset -10px 0 20px -8px rgba(0, 0, 0, 0.20), inset 1px 0 3px rgba(0, 0, 0, 0.06);
}

.sql-note-page.--right {
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
    box-shadow: inset 10px 0 20px -8px rgba(0, 0, 0, 0.20), inset -1px 0 3px rgba(0, 0, 0, 0.06);
}

/* ─── HARD FRONT COVER ────────────────────────────────────── */
.cover-page {
    background: radial-gradient(circle at 75% 25%, #0d2847 0%, #061528 65%, #020914 100%);
    border: 2px solid rgba(56, 189, 248, 0.35);
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.8), inset 0 0 12px rgba(56, 189, 248, 0.25);
    color: #ffffff;
}

.cover-inner {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    padding: 24px 22px;
    box-sizing: border-box;
    position: relative;
    background-image:
        radial-gradient(rgba(56, 189, 248, 0.12) 1px, transparent 1px),
        radial-gradient(rgba(16, 185, 129, 0.08) 1px, transparent 1px);
    background-size: 20px 20px, 10px 10px;
    background-position: 0 0, 10px 10px;
}

.cover-top-ribbon {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(56, 189, 248, 0.2);
}

.cover-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.68rem;
    font-weight: 800;
    color: #38bdf8;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.cover-order {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.68rem;
    font-weight: 700;
    color: #94a3b8;
}

.cover-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin: auto 0;
}

.cover-emblem {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: #ffffff;
    display: grid;
    place-items: center;
    font-size: 1.6rem;
    box-shadow: 0 8px 22px rgba(16, 185, 129, 0.40);
    margin-bottom: 12px;
}

.cover-title {
    font-size: 1.7rem;
    font-weight: 800;
    line-height: 1.18;
    color: #ffffff;
    margin: 0 0 6px;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.cover-subtitle {
    font-size: 0.90rem;
    font-weight: 700;
    color: #38bdf8;
    margin: 0 0 10px;
}

.cover-desc {
    font-size: 0.80rem;
    line-height: 1.5;
    color: #94a3b8;
    max-width: 360px;
    margin: 0;
}

.cover-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.cover-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #94a3b8;
}

.cover-open-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.76rem;
    font-weight: 700;
    color: #021a12;
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 3px 12px rgba(16, 185, 129, 0.4);
    transition: all 0.2s ease;
}

.cover-open-trigger:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 16px rgba(16, 185, 129, 0.55);
}

/* ─── TABLE OF CONTENTS PAGES ────────────────────────────── */
.toc-page {
    background: #fdfefe;
    color: #1e293b !important;
}

.toc-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 18px 20px;
    box-sizing: border-box;
    color: #1e293b !important;
}

.toc-header {
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e2e8f0;
}

.toc-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.65rem;
    font-weight: 800;
    color: #059669;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.toc-heading {
    font-size: 1.10rem;
    font-weight: 800;
    color: #0f172a;
    margin: 2px 0 1px;
}

.toc-subheading {
    font-size: 0.70rem;
    color: #64748b;
    margin: 0;
}

.toc-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
    overflow-y: auto;
}

.toc-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    border-radius: 7px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.15s ease;
}

.toc-item:hover {
    background: #eff6ff;
    border-color: #38bdf8;
    transform: translateX(2px);
    box-shadow: 0 2px 8px rgba(56, 189, 248, 0.12);
}

.toc-item-left {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
}

.toc-num {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    font-weight: 800;
    color: #0284c7;
    background: #e0f2fe;
    padding: 2px 6px;
    border-radius: 5px;
    flex-shrink: 0;
}

.toc-item-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.toc-item-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.toc-item-desc {
    font-size: 0.68rem;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.toc-item-right {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.toc-page-pill {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.68rem;
    font-weight: 600;
    color: #64748b;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    padding: 1px 6px;
    border-radius: 4px;
}

.toc-arrow {
    font-size: 0.95rem;
    color: #94a3b8;
}

.toc-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e2e8f0;
}

.toc-hint {
    font-size: 0.68rem;
    color: #64748b;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ─── CHAPTER DIVIDER PAGES ──────────────────────────────── */
.chapter-divider-page {
    background: radial-gradient(circle at 80% 20%, #0f2744 0%, #081a30 60%, #040e1c 100%);
    border: 1px solid rgba(56, 189, 248, 0.25);
    color: #ffffff;
}

.chapter-divider-inner {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    padding: 22px 22px;
    box-sizing: border-box;
    background-image:
        radial-gradient(rgba(56, 189, 248, 0.1) 1px, transparent 1px);
    background-size: 16px 16px;
}

.ch-badge-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(56, 189, 248, 0.2);
}

.ch-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.68rem;
    font-weight: 800;
    color: #38bdf8;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.ch-count {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.68rem;
    font-weight: 700;
    color: #94a3b8;
}

.ch-main-title {
    font-size: 1.45rem;
    font-weight: 800;
    color: #ffffff;
    margin: 10px 0 6px;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.ch-description {
    font-size: 0.80rem;
    line-height: 1.5;
    color: #cbd5e1;
    margin-bottom: 12px;
}

.ch-contents-preview {
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(56, 189, 248, 0.18);
    border-radius: 10px;
    padding: 12px 14px;
    flex: 1;
    overflow-y: auto;
    margin-bottom: 10px;
}

.ch-contents-heading {
    font-size: 0.70rem;
    font-weight: 800;
    color: #34d399;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.ch-parts-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ch-parts-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.76rem;
    color: #e2e8f0;
}

.part-bullet {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    font-weight: 700;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.ch-divider-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.74rem;
    font-weight: 700;
    color: #38bdf8;
}

/* ─── INTERIOR EDUCATIONAL PAGES ─────────────────────────── */
.interior-page {
    background: #ffffff !important;
    color: #1e293b !important;
}

.page-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 22px 26px 16px;
    box-sizing: border-box;
    position: relative;
    z-index: 2;
    color: #1e293b !important;
}

/* Page Top Header Bar */
.page-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 12px;
    flex-shrink: 0;
    gap: 10px;
}

.page-top-left {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
    min-width: 0;
}

.page-ch-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    border-radius: 4px;
    background: rgba(99, 102, 241, 0.1);
    color: #4f46e5;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}

.page-topic-title {
    font-size: 0.72rem;
    font-weight: 700;
    color: #334155;
    letter-spacing: 0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.page-order-num {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.68rem;
    font-weight: 700;
    color: #64748b;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 4px;
    flex-shrink: 0;
    white-space: nowrap;
}

/* Page Content Area */
.page-content-area {
    flex: 1;
    overflow-y: auto !important;
    padding-right: 6px;
    user-select: none !important;
    -webkit-user-select: none !important;
    color: #1e293b !important;
}

.page-title {
    font-size: 1.30rem;
    font-weight: 800;
    color: #0f172a;
    margin: 2px 0 14px;
    letter-spacing: -0.02em;
    line-height: 1.30;
}

.page-text-body {
    font-size: 0.86rem;
    line-height: 1.70;
    color: #334155;
    margin-bottom: 14px;
}

.page-text-body p {
    margin-bottom: 12px;
    line-height: 1.70;
}

.page-text-body strong {
    color: #0f172a;
    font-weight: 700;
}

/* Formatted Note Callouts (Key Points, Examples, Tips) */
.note-callout {
    margin: 14px 0;
    padding: 12px 16px;
    border-radius: 9px;
    font-size: 0.83rem;
    line-height: 1.62;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    color: #1e293b !important;
}

.callout-title {
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 8px;
}

.callout-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: #1e293b !important;
}

.callout-body,
.callout-body p,
.callout-body span,
.callout-body div {
    color: inherit !important;
}

.callout-keypoints {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-left: 3.5px solid #6366f1 !important;
    color: #1e293b !important;
}

.callout-keypoints .callout-title {
    color: #4f46e5 !important;
}

.callout-keypoints .callout-body,
.callout-keypoints .callout-body * {
    color: #1e293b !important;
}

.callout-example {
    background: #f0f9ff !important;
    border: 1px solid #bae6fd !important;
    border-left: 3.5px solid #0284c7 !important;
    color: #0f172a !important;
}

.callout-example .callout-title {
    color: #0284c7 !important;
}

.callout-example .callout-body,
.callout-example .callout-body * {
    color: #0f172a !important;
}

.callout-tip {
    background: #fffbeb !important;
    border: 1px solid #fde68a !important;
    border-left: 3.5px solid #d97706 !important;
    color: #78350f !important;
}

.callout-tip .callout-title {
    color: #b45309 !important;
}

.callout-tip .callout-body,
.callout-tip .callout-body * {
    color: #78350f !important;
}

.callout-row {
    margin-bottom: 6px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.55;
    color: #1e293b !important;
}

.callout-row span {
    color: inherit !important;
}

.callout-row:last-child {
    margin-bottom: 0;
}

.callout-bullet {
    color: #6366f1 !important;
    font-weight: 800;
    font-size: 0.82rem;
    line-height: 1.4;
    flex-shrink: 0;
}

/* Inline code badges in notes text */
.inline-code {
    background: #f1f5f9 !important;
    color: #4f46e5 !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    font-family: 'JetBrains Mono', Consolas, monospace !important;
    font-size: 0.82em !important;
    border: 1px solid #e2e8f0 !important;
}

/* Standalone bullet list group (when no callout heading is used) */
.note-bullet-group {
    margin: 12px 0 14px;
    padding: 12px 16px;
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-left: 3.5px solid #6366f1 !important;
    border-radius: 9px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: #1e293b !important;
}

.note-bullet-group .callout-row,
.note-bullet-group .callout-row span {
    color: #1e293b !important;
}

/* SQL Code Block Inside Page */
.page-sql-block {
    background: #090e17 !important;
    border: 1px solid #1e293b !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25) !important;
    margin: 16px 0 12px !important;
}

.sql-block-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 8px 12px !important;
    background: #050910 !important;
    border-bottom: 1px solid #1e293b !important;
}

.sql-block-dots {
    display: flex;
    gap: 5px;
}

.sql-block-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.dot-red {
    background: #ef4444;
}

.dot-yellow {
    background: #eab308;
}

.dot-green {
    background: #22c55e;
}

.sql-block-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.66rem;
    font-weight: 700;
    color: #38bdf8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-copy-code {
    display: none !important;
}

.sql-pre,
.sql-code,
.page-sql-block,
.page-text-body,
.page-title,
.cover-inner,
.toc-inner,
.chapter-divider-inner {
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    -webkit-touch-callout: none !important;
}

.page-sql-block .sql-pre {
    margin: 0 !important;
    padding: 14px 18px !important;
    background: #090e17 !important;
    overflow-x: auto !important;
    border: none !important;
    border-radius: 0 0 10px 10px !important;
}

.page-sql-block .sql-code {
    display: block !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace !important;
    font-size: 0.81rem !important;
    line-height: 1.75 !important;
    color: #f1f5f9 !important;
    white-space: pre !important;
    word-break: normal !important;
    word-spacing: normal !important;
    tab-size: 4 !important;
}

/* SQL Syntax Highlighting Tokens */
.sql-token-comment {
    color: #94a3b8 !important;
    font-style: italic !important;
    opacity: 0.9;
}

.sql-token-keyword {
    color: #fbbf24 !important;
    font-weight: 700 !important;
}

.sql-token-string {
    color: #34d399 !important;
}

.sql-token-number {
    color: #38bdf8 !important;
}

.sql-token-table {
    color: #a78bfa !important;
}


/* Page Bottom Footer Bar */
.page-bottom-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 6px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    margin-top: 6px;
    flex-shrink: 0;
}

.page-watermark {
    font-size: 0.65rem;
    font-weight: 600;
    color: #94a3b8;
    letter-spacing: 0.02em;
}

.page-num-pill {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.68rem;
    font-weight: 700;
    color: #0369a1;
    background: #e0f2fe;
    padding: 1px 6px;
    border-radius: 5px;
}

/* ─── HARD BACK COVER ─────────────────────────────────────── */
.back-cover-page {
    background: radial-gradient(circle at 25% 75%, #0d2847 0%, #061528 65%, #020914 100%);
    border: 2px solid rgba(16, 185, 129, 0.35);
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.8), inset 0 0 12px rgba(16, 185, 129, 0.25);
    color: #ffffff;
}

.back-cover-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 26px 24px;
    box-sizing: border-box;
    text-align: center;
}

.back-cover-emblem {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: #ffffff;
    display: grid;
    place-items: center;
    font-size: 1.6rem;
    box-shadow: 0 8px 22px rgba(16, 185, 129, 0.40);
    margin-bottom: 12px;
}

.back-cover-title {
    font-size: 1.45rem;
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 6px;
    letter-spacing: -0.015em;
}

.back-cover-desc {
    font-size: 0.80rem;
    line-height: 1.5;
    color: #94a3b8;
    max-width: 340px;
    margin: 0 0 16px;
}

.back-cover-desc strong {
    color: #34d399;
}

.back-cover-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    max-width: 250px;
    margin-bottom: 16px;
}

.btn-back-cover {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.80rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.btn-back-cover.btn-practice {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    color: #021a12;
    box-shadow: 0 3px 12px rgba(16, 185, 129, 0.35);
}

.btn-back-cover.btn-practice:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 16px rgba(16, 185, 129, 0.50);
}

.btn-back-cover.btn-toc-jump {
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: #38bdf8;
}

.btn-back-cover.btn-toc-jump:hover {
    background: rgba(56, 189, 248, 0.22);
}

.btn-back-cover.btn-all-notes {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #94a3b8;
}

.btn-back-cover.btn-all-notes:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
}

.back-cover-footer {
    font-size: 0.68rem;
    color: #64748b;
}

/* ══════════════════════════════════════════════════════════
   FULLSCREEN MODE STYLES (.book-fullscreen-active)
   ══════════════════════════════════════════════════════════ */
.book-fullscreen-active {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    z-index: 999999 !important;
    background: radial-gradient(circle at 50% 20%, #0c1a2f 0%, #06101e 60%, #02060e 100%) !important;
    margin: 0 !important;
    padding: 6px 16px !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    overflow: hidden !important;
}

.book-fullscreen-active .book-toolbar {
    margin-bottom: 4px;
    height: 38px;
    background: rgba(11, 23, 44, 0.92);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

.book-fullscreen-active .book-stage {
    flex: 1;
    min-height: unset !important;
    height: calc(100vh - 52px) !important;
    margin: 0 auto !important;
}

/* ══════════════════════════════════════════════════════════
   DARK THEME BOOK INTERIOR OVERRIDES (Preserves crisp dark text on white pages)
   ══════════════════════════════════════════════════════════ */
html[data-bs-theme="dark"] .sql-note-page,
html[data-bs-theme="dark"] .interior-page,
html[data-bs-theme="dark"] .toc-page,
html[data-bs-theme="dark"] .page-inner,
html[data-bs-theme="dark"] .page-content-area,
html[data-bs-theme="dark"] .page-text-body,
html[data-bs-theme="dark"] .page-text-body p,
html[data-bs-theme="dark"] .note-callout,
html[data-bs-theme="dark"] .callout-body,
html[data-bs-theme="dark"] .callout-body *,
html[data-bs-theme="dark"] .callout-row,
html[data-bs-theme="dark"] .callout-row span,
html[data-bs-theme="dark"] .note-bullet-group,
html[data-bs-theme="dark"] .note-bullet-group * {
    color: #1e293b !important;
}

html[data-bs-theme="dark"] .page-title {
    color: #0f172a !important;
}

html[data-bs-theme="dark"] .page-text-body strong {
    color: #0f172a !important;
}

html[data-bs-theme="dark"] .page-topic-title {
    color: #334155 !important;
}

html[data-bs-theme="dark"] .callout-keypoints {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
    color: #1e293b !important;
}

html[data-bs-theme="dark"] .callout-keypoints .callout-title {
    color: #4f46e5 !important;
}

html[data-bs-theme="dark"] .callout-keypoints .callout-bullet {
    color: #6366f1 !important;
}

html[data-bs-theme="dark"] .callout-example {
    background: #f0f9ff !important;
    border-color: #bae6fd !important;
    color: #0f172a !important;
}

html[data-bs-theme="dark"] .callout-example .callout-title {
    color: #0284c7 !important;
}

html[data-bs-theme="dark"] .callout-example .callout-body,
html[data-bs-theme="dark"] .callout-example .callout-body * {
    color: #0f172a !important;
}

html[data-bs-theme="dark"] .callout-tip {
    background: #fffbeb !important;
    border-color: #fde68a !important;
    color: #78350f !important;
}

html[data-bs-theme="dark"] .callout-tip .callout-title {
    color: #b45309 !important;
}

html[data-bs-theme="dark"] .callout-tip .callout-body,
html[data-bs-theme="dark"] .callout-tip .callout-body * {
    color: #78350f !important;
}

html[data-bs-theme="dark"] .inline-code {
    background: #f1f5f9 !important;
    color: #4f46e5 !important;
    border-color: #e2e8f0 !important;
}

/* ══════════════════════════════════════════════════════════
   LIGHT THEME OVERRIDES
   ══════════════════════════════════════════════════════════ */
html[data-bs-theme="light"] .book-toolbar {
    background: rgba(255, 255, 255, 0.94);
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}

html[data-bs-theme="light"] .btn-book-action.btn-icon-only {
    background: #f1f5f9;
    border-color: rgba(0, 0, 0, 0.08);
    color: #475569;
}

html[data-bs-theme="light"] .btn-book-action.btn-icon-only:hover {
    background: #e2e8f0;
    color: #0f172a;
}

html[data-bs-theme="light"] .btn-fullscreen {
    background: #e0f2fe;
    border-color: #bae6fd;
    color: #0369a1;
}

html[data-bs-theme="light"] .chapter-selector-wrap {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.12);
}

html[data-bs-theme="light"] .chapter-select {
    color: #0f172a;
}

html[data-bs-theme="light"] .chapter-select option {
    background: #ffffff;
    color: #0f172a;
}

html[data-bs-theme="light"] .current-chapter-pill {
    background: #f1f5f9;
    border-color: rgba(0, 0, 0, 0.08);
    color: #0284c7;
}

html[data-bs-theme="light"] .book-fullscreen-active {
    background: radial-gradient(circle at 50% 20%, #e2e8f0 0%, #cbd5e1 60%, #94a3b8 100%) !important;
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE DESIGN (Tablets & Mobile)
   ══════════════════════════════════════════════════════════ */
@media (max-width: 992px) {
    .book-toolbar {
        display: flex;
        justify-content: space-between;
        gap: 8px;
    }

    .chapter-select {
        max-width: 140px;
    }

    .current-chapter-pill {
        max-width: 160px;
    }
}

@media (max-width: 768px) {
    .beginner-book-wrapper {
        padding: 4px 6px 10px;
    }

    .book-toolbar {
        height: auto;
        padding: 6px 10px;
        flex-wrap: wrap;
    }

    .chapter-select {
        max-width: 110px;
        font-size: 0.72rem;
    }

    .current-chapter-pill {
        max-width: 130px;
        font-size: 0.72rem;
        padding: 0 8px;
    }

    .page-inner,
    .toc-inner,
    .chapter-divider-inner {
        padding: 14px 14px;
    }

    .page-title {
        font-size: 1.05rem;
    }

    .page-text-body {
        font-size: 0.78rem;
    }

    .sql-code {
        font-size: 0.72rem;
    }

    .cover-inner,
    .back-cover-inner {
        padding: 18px 16px;
    }

    .cover-title {
        font-size: 1.4rem;
    }
}

/* ══════════════════════════════════════════════════════════
   INSIDE PAGE BOTTOM-LEFT & BOTTOM-RIGHT TURN BUTTONS & HOTSPOTS
   ══════════════════════════════════════════════════════════ */
.page-turn-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    outline: none;
    user-select: none;
    text-decoration: none;
    z-index: 20;
    line-height: 1.4;
    white-space: nowrap;
}

.page-turn-prev {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
}

.page-turn-prev:hover {
    background: #e2e8f0;
    color: #0f172a;
    border-color: #94a3b8;
    transform: translateX(-2px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.page-turn-next {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}

.page-turn-next:hover {
    transform: translateX(2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.5);
    color: #ffffff;
}

/* Chapter divider dark page buttons */
.chapter-divider-page .page-turn-prev {
    background: rgba(255, 255, 255, 0.12);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.chapter-divider-page .page-turn-prev:hover {
    background: rgba(255, 255, 255, 0.22);
    color: #ffffff;
}

.chapter-divider-page .page-turn-next {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    color: #021a12;
    box-shadow: 0 2px 10px rgba(16, 185, 129, 0.4);
}

.chapter-divider-page .page-turn-next:hover {
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.55);
}

/* Page bottom bar alignment */
.page-bottom-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 6px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    margin-top: 6px;
    flex-shrink: 0;
    gap: 8px;
}

.page-bottom-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.68rem;
    color: #64748b;
    overflow: hidden;
}

/* Corner hotspots */
.page-corner-hotspot {
    position: absolute;
    bottom: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 4px;
    cursor: pointer;
    z-index: 15;
    transition: all 0.2s ease;
    opacity: 0.35;
    font-size: 0.75rem;
    color: #64748b;
}

.page-corner-hotspot:hover {
    opacity: 1;
    color: #6366f1;
    transform: scale(1.15);
}

.page-corner-left {
    left: 0;
    border-bottom-left-radius: 6px;
}

.page-corner-right {
    right: 0;
    border-bottom-right-radius: 6px;
}

/* Smooth content scrollbar */
.page-content-area::-webkit-scrollbar {
    width: 5px;
}

.page-content-area::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.page-content-area::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.page-content-area::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}