/**
 * ==============================================================================
 * VIDYORIC 3.0 — DEDICATED STUDY APP WORKSPACE & ASK DECKZY AI COPILOT
 * File: public/css/study-workspace.css
 * ==============================================================================
 */

body.study-app-body {
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
    background-color: #F8FAFC;
    font-family: 'Inter', 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    color: #0F172A;
}

/* ==============================================================================
   MARATHI STUDY WORKSPACE TYPOGRAPHY (POPPINS FONT ENGINE)
   Native Devanagari typography applied across Marathi decks and steps
   ============================================================================== */
[data-deck-lang="mr"],
body[data-deck-lang="mr"],
.study-workspace-grid[data-deck-lang="mr"] {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif !important;
}

[data-deck-lang="mr"] .curriculum-deck-title,
[data-deck-lang="mr"] .step-header-title,
[data-deck-lang="mr"] .stage-title,
[data-deck-lang="mr"] .stage-tag,
[data-deck-lang="mr"] .step-item-title,
[data-deck-lang="mr"] .stage-step-count,
[data-deck-lang="mr"] .step-title-text,
[data-deck-lang="mr"] .notes-content h1,
[data-deck-lang="mr"] .notes-content h2,
[data-deck-lang="mr"] .notes-content h3,
[data-deck-lang="mr"] .notes-content p,
[data-deck-lang="mr"] .notes-content li,
[data-deck-lang="mr"] .notes-content td,
[data-deck-lang="mr"] .notes-content th,
[data-deck-lang="mr"] .callout-text,
[data-deck-lang="mr"] .exam-trap-box,
[data-deck-lang="mr"] .fc-prompt,
[data-deck-lang="mr"] .fc-answer,
[data-deck-lang="mr"] .fc-hint,
[data-deck-lang="mr"] .fc-preview-title,
[data-deck-lang="mr"] .quiz-question-text,
[data-deck-lang="mr"] .quiz-option-text,
[data-deck-lang="mr"] .quiz-explanation-text,
[data-deck-lang="mr"] .audio-player-title,
[data-deck-lang="mr"] .audio-transcript-container,
[data-deck-lang="mr"] .video-transcript-box {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif !important;
}

/* Retain KaTeX mathematical formatting */
[data-deck-lang="mr"] .katex,
[data-deck-lang="mr"] .katex * {
    font-family: 'KaTeX_Main', 'Cambria Math', serif !important;
}

/* Retain Monospace for ASCII diagrams and code blocks */
[data-deck-lang="mr"] pre,
[data-deck-lang="mr"] code,
[data-deck-lang="mr"] .code-font {
    font-family: 'JetBrains Mono', monospace !important;
}

.study-app-layout {
    display: flex;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    position: relative;
}

/* ==============================================================================
   1. COLLAPSIBLE DEEP NAVY APP SIDEBAR (DESKTOP + RESPONSIVE MOBILE OFF-CANVAS)
   ============================================================================== */
.study-app-sidebar {
    width: 230px;
    background: #021226;
    color: #FFFFFF;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    height: 100vh;
    transition: width 0.28s cubic-bezier(0.4, 0, 0.2, 1),
                left 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    z-index: 100;
    overflow-x: hidden;
}

.study-app-sidebar.collapsed {
    width: 72px;
}

/* Logo & Branding in Sidebar Header: High contrast white pill badge */
.sidebar-top-branding {
    padding: 0.85rem 0.85rem 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    min-height: 64px;
    box-sizing: border-box;
}

.sidebar-brand-card {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    background: #FFFFFF;
    border-radius: 12px;
    padding: 0.4rem 0.75rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    width: 100%;
    transition: all 0.2s ease;
    overflow: hidden;
    white-space: nowrap;
    box-sizing: border-box;
}

.sidebar-brand-card:hover {
    box-shadow: 0 4px 14px rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.sidebar-brand-img {
    height: 28px;
    width: auto;
    flex-shrink: 0;
    display: block;
}

.sidebar-brand-img-small {
    display: none;
}

.sidebar-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
    overflow: hidden;
    transition: opacity 0.2s ease;
}

.sidebar-brand-text .brand-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 900;
    font-size: 1rem;
    letter-spacing: 0.03em;
    color: #012B5A;
}

.sidebar-brand-text .brand-title span {
    color: #BD9B61;
}

.sidebar-brand-text .brand-subtitle {
    font-size: 0.62rem;
    color: #64748B;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.06em;
}

/* Collapsed state adjustments */
.study-app-sidebar.collapsed .sidebar-brand-card {
    width: 44px;
    height: 44px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}

.study-app-sidebar.collapsed .sidebar-brand-img-full {
    display: none;
}

.study-app-sidebar.collapsed .sidebar-brand-img-small {
    display: block;
    height: 30px;
    width: 30px;
    object-fit: contain;
}

.study-app-sidebar.collapsed .sidebar-brand-text {
    display: none;
    opacity: 0;
}

/* Collapse / Expand Toggle Button */
.sidebar-collapse-btn {
    background: transparent;
    border: none;
    color: #94A3B8;
    padding: 0.7rem 1.15rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    white-space: nowrap;
}

.sidebar-collapse-btn:hover {
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.06);
}

.collapse-icon {
    font-size: 1.1rem;
    font-family: monospace;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.study-app-sidebar.collapsed .collapse-text {
    display: none;
    opacity: 0;
}

.study-app-sidebar.collapsed .sidebar-collapse-btn {
    justify-content: center;
    padding: 0.75rem 0;
}

/* Navigation Items */
.sidebar-nav-menu {
    display: flex;
    flex-direction: column;
    padding: 0.85rem 0.55rem;
    gap: 0.35rem;
    flex-grow: 1;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.65rem 0.85rem;
    border-radius: 10px;
    color: #94A3B8;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.sidebar-nav-item:hover {
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.08);
}

.sidebar-nav-item.active {
    color: #FFFFFF;
    background: rgba(37, 99, 235, 0.22);
    border-left: 3px solid #3B82F6;
}

.nav-item-icon {
    font-size: 1.15rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.study-app-sidebar.collapsed .nav-item-label {
    display: none;
    opacity: 0;
}

.study-app-sidebar.collapsed .sidebar-nav-item {
    justify-content: center;
    padding: 0.75rem 0;
}

/* User Profile Footer */
.sidebar-user-footer {
    padding: 0.85rem 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.user-profile-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    white-space: nowrap;
}

.user-avatar-initials {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #012B5A;
    border: 1.5px solid #BD9B61;
    color: #FFFFFF;
    font-weight: 800;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-info-text {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.user-display-name {
    font-size: 0.82rem;
    font-weight: 700;
    color: #FFFFFF;
    text-overflow: ellipsis;
    overflow: hidden;
}

.user-role-badge {
    font-size: 0.68rem;
    color: #94A3B8;
}

.user-signout-link {
    color: #94A3B8;
    text-decoration: none;
    font-size: 0.78rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.user-signout-link:hover {
    color: #EF4444;
    background: rgba(239, 68, 68, 0.1);
}

.study-app-sidebar.collapsed .user-info-text,
.study-app-sidebar.collapsed .signout-text {
    display: none;
    opacity: 0;
}

.study-app-sidebar.collapsed .sidebar-user-footer {
    align-items: center;
    padding: 0.75rem 0;
}

/* Mobile Sidebar Backdrop Overlay */
.study-backdrop-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 90;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.study-backdrop-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* ==============================================================================
   2. MAIN COLUMN & TOP HEADER BAR
   ============================================================================== */
.study-main-col {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    background: #F8FAFC;
    min-width: 0;
}

.study-top-header {
    height: 64px;
    background: #FFFFFF;
    border-bottom: 1px solid #E2E8F0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    flex-shrink: 0;
    gap: 1rem;
    box-sizing: border-box;
}

.header-left-group {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-grow: 1;
    min-width: 0;
}

/* Mobile Sidebar & Curriculum Toggle Buttons */
.mobile-header-toggle-btn {
    display: none;
    background: #F1F5F9;
    border: 1px solid #E2E8F0;
    color: #1E293B;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s ease;
}
.mobile-header-toggle-btn:hover {
    background: #E2E8F0;
}

/* Header Deck Indicator (Replaced Global Search in Deck Study Workspace) */
.header-deck-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.85rem;
    background: #F1F5F9;
    border: 1px solid #E2E8F0;
    border-radius: 99px;
    max-width: 320px;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.deck-tag-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.deck-indicator-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #1E293B;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

[data-study-theme="dark"] .header-deck-indicator {
    background: #0B152B;
    border-color: #1E293B;
}

[data-study-theme="dark"] .deck-indicator-title {
    color: #E2E8F0;
}

/* Sleek, Compact Search Bar (Height 36px, properly proportional) */
.header-search-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #F8FAFC;
    border: 1px solid #CBD5E1;
    border-radius: 99px;
    height: 36px;
    max-height: 36px;
    padding: 0 0.85rem;
    width: clamp(200px, 26vw, 360px);
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.header-search-wrap:focus-within {
    border-color: #2563EB;
    background: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-icon {
    font-size: 0.85rem;
    color: #64748B;
    flex-shrink: 0;
}

.header-search-input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.82rem;
    color: #0F172A;
    width: 100%;
    height: 100%;
    padding: 0;
}

.header-search-input::placeholder {
    color: #94A3B8;
}

/* Right Header Controls */
.header-right-controls {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-shrink: 0;
}

.header-badge-pill {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    height: 34px;
    padding: 0 0.75rem;
    border-radius: 99px;
    font-size: 0.8rem;
    font-weight: 600;
    background: #F1F5F9;
    border: 1px solid #E2E8F0;
    color: #334155;
    white-space: nowrap;
    box-sizing: border-box;
}

.board-context-pill {
    background: #F8FAFC;
    cursor: pointer;
}
.board-context-pill .arrow-down { font-size: 0.7rem; color: #64748B; }

.streak-pill { color: #D97706; }

.sparks-pill {
    background: #FFFBEB;
    border-color: #FDE68A;
    color: #B45309;
}
.sparks-symbol { color: #F59E0B; font-size: 0.9rem; }
.sparks-plus {
    background: #F59E0B;
    color: #FFFFFF;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 800;
    margin-left: 0.15rem;
}

.xp-pill {
    background: #FAF5FF;
    border-color: #DDD6FE;
    color: #7C3AED;
}

/* Ask AI (Ask Deckzy) Action Button */
.btn-ask-deckzy {
    background: linear-gradient(135deg, #012B5A 0%, #0E3666 100%);
    border: 1px solid rgba(189, 155, 97, 0.4);
    color: #FFFFFF;
    height: 36px;
    padding: 0 1rem;
    border-radius: 99px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    transition: all 0.22s ease;
    box-shadow: 0 2px 8px rgba(1, 43, 90, 0.18);
    white-space: nowrap;
    box-sizing: border-box;
}

.btn-ask-deckzy:hover,
.btn-ask-deckzy.active {
    background: linear-gradient(135deg, #0E3666 0%, #1D4ED8 100%);
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.35);
    transform: translateY(-1px);
}

.deckzy-sparkle {
    font-size: 0.95rem;
    filter: drop-shadow(0 0 4px rgba(251, 191, 36, 0.6));
}

/* ==============================================================================
   3. STUDY CONTENT VIEWPORT & 3-PANE WORKSPACE
   ============================================================================== */
.study-content-viewport {
    flex-grow: 1;
    overflow: hidden;
    display: flex;
    height: calc(100vh - 64px);
    width: 100%;
    position: relative;
}

.study-workspace-grid {
    display: flex;
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
}

/* ------------------------------------------------------------------------------
   PANE 1: LEFT CURRICULUM TREE PANE
   ------------------------------------------------------------------------------ */
.curriculum-pane {
    width: 320px;
    flex-shrink: 0;
    background: #FFFFFF;
    border-right: 1px solid #E2E8F0;
    height: 100%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
}

.curriculum-pane-inner {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}

.curriculum-top-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.back-decks-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #475569;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.15s ease;
}
.back-decks-link:hover { color: #012B5A; }

.difficulty-pill {
    background: #EFF6FF;
    color: #2563EB;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.2rem 0.65rem;
    border-radius: 99px;
}

.curriculum-deck-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 800;
    color: #0F172A;
    line-height: 1.35;
}

.curriculum-progress-block {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    font-weight: 700;
    color: #334155;
}

.progress-bar-track {
    height: 6px;
    background: #E2E8F0;
    border-radius: 99px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    transition: width 0.3s ease;
}

.progress-sub-text {
    font-size: 0.72rem;
    color: #64748B;
}

.tree-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.72rem;
    font-weight: 800;
    color: #475569;
    letter-spacing: 0.05em;
    padding-top: 0.5rem;
    border-top: 1px solid #F1F5F9;
}

.tree-count {
    color: #64748B;
    font-weight: 500;
}

/* ==============================================================================
   CURRICULUM LEARNING ROADMAP TREE & STEP NODES
   ============================================================================== */

.curriculum-roadmap-tree {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.15rem; /* tight between stages, no bulky padding */
    padding-left: 0.25rem;
}

/* Roadmap Stage Node */
.curriculum-folder-card.tree-roadmap-node {
    position: relative;
    z-index: 2;
    background: transparent;
    border: none;
    border-radius: 10px;
    overflow: visible;
    margin-bottom: 0.15rem;
    transition: background 0.18s ease;
}

/* Single vertical connector line between closed stage nodes */
.tree-roadmap-node:not(:last-child):not(.node-open)::after {
    content: '';
    position: absolute;
    top: 30px;
    bottom: -6px;
    left: 12px;
    width: 2px;
    background: #2563EB;
    z-index: 1;
    border-radius: 2px;
}

/* Node Header (Stage Row) */
.folder-header.node-header {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.45rem 0.5rem 0.45rem 0;
    background: transparent;
    border-bottom: none;
    border-radius: 8px;
    user-select: none;
    position: relative;
    z-index: 3;
    transition: all 0.18s ease;
}

.folder-header.node-header:hover {
    background: rgba(241, 245, 249, 0.85);
}

.tree-roadmap-node.node-open > .folder-header.node-header {
    background: rgba(239, 246, 255, 0.65);
}

/* Stage Marker Circle (1, 2, 3...) */
.node-circle-marker {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    background: #FFFFFF;
    border: 2px solid #CBD5E1;
    color: #64748B;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
    flex-shrink: 0;
    z-index: 3;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.node-circle-marker.active,
.tree-roadmap-node.node-open .node-circle-marker {
    background: #2563EB;
    border-color: #2563EB;
    color: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

/* Header Text (Stage Tag + Topic Name) */
.node-header-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    flex-grow: 1;
    min-width: 0;
}

.node-stage-tag {
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    color: #2563EB;
    text-transform: uppercase;
}

.folder-name {
    font-size: 0.8rem;
    font-weight: 700;
    color: #1E293B;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.node-header-meta {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

.folder-badge {
    background: #F1F5F9;
    color: #475569;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.12rem 0.45rem;
    border-radius: 99px;
}

.folder-arrow {
    font-size: 0.72rem;
    color: #94A3B8;
    transition: transform 0.2s ease;
}

/* Sub-step branch connecting from the stage node */
.curriculum-step-list.node-step-branch {
    position: relative;
    margin-left: 12px;
    padding-left: 1rem;
    padding-top: 0.25rem;
    padding-bottom: 0.35rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

/* For open non-last stage nodes, draw a single dashed branch line connecting to next stage */
.tree-roadmap-node:not(:last-child).node-open .node-step-branch {
    border-left: 2px dashed #94A3B8;
}
.tree-roadmap-node:not(:last-child).node-open::after {
    content: '';
    position: absolute;
    bottom: -6px;
    height: 8px;
    left: 12px;
    width: 2px;
    background: #CBD5E1;
    z-index: 1;
}

/* For the LAST stage node (e.g. Stage 3), the line terminates cleanly at the last child item without dangling below */
.tree-roadmap-node:last-child.node-open .node-step-branch {
    border-left: none;
    position: relative;
}
.tree-roadmap-node:last-child.node-open .node-step-branch::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 1.35rem;
    left: 0;
    width: 2px;
    border-left: 2px dashed #CBD5E1;
}

/* Step Items Inside Branch */
.step-nav-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 0.6rem;
    border-radius: 8px;
    border-bottom: none;
    cursor: pointer;
    background: transparent;
    position: relative;
    transition: all 0.15s ease;
}

/* Branch tick connector */
.step-nav-item::before {
    content: '';
    position: absolute;
    left: -1rem;
    top: 50%;
    width: 0.75rem;
    height: 1.5px;
    background: #CBD5E1;
}

.step-nav-item:hover {
    background: #F8FAFC;
}

.step-nav-item.active {
    background: #EFF6FF;
    box-shadow: 0 1px 4px rgba(37, 99, 235, 0.08);
}

.step-nav-item.active::before {
    background: #2563EB;
}

.step-check-col {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.step-check-done {
    width: 19px;
    height: 19px;
    border-radius: 50%;
    background: #10B981;
    color: #FFFFFF;
    font-size: 0.68rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(16, 185, 129, 0.25);
}

.step-number-active {
    width: 19px;
    height: 19px;
    border-radius: 50%;
    background: #2563EB;
    color: #FFFFFF;
    font-size: 0.7rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.step-number-idle {
    width: 19px;
    height: 19px;
    border-radius: 50%;
    background: #E2E8F0;
    color: #64748B;
    font-size: 0.68rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.step-nav-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.step-nav-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: #1E293B;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.step-nav-item.active .step-nav-title {
    color: #1D4ED8;
    font-weight: 700;
}

.step-nav-meta {
    font-size: 0.68rem;
    color: #64748B;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.resource-step-item {
    text-decoration: none;
}

/* Resources box */
.deck-resources-box {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid #E2E8F0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.resources-header {
    font-size: 0.72rem;
    font-weight: 800;
    color: #64748B;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.res-count-badge {
    background: #EFF6FF;
    color: #2563EB;
    font-size: 0.68rem;
    font-weight: 800;
    padding: 0.15rem 0.45rem;
    border-radius: 99px;
    border: 1px solid #DBEAFE;
}

.resources-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.resource-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #334155;
    font-size: 0.8rem;
    text-decoration: none;
    padding: 0.45rem 0.55rem;
    border-radius: 8px;
    background: #FFFFFF;
    border: 1px solid transparent;
    transition: all 0.18s ease;
}

.resource-link:hover {
    background: #F1F5F9;
    border-color: #E2E8F0;
    color: #012B5A;
}

.resource-link .res-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.res-title-wrap {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex: 1;
    min-width: 0;
}

.res-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
    font-size: 0.78rem;
    line-height: 1.35;
}

.res-size {
    font-size: 0.68rem;
    color: #94A3B8;
    font-weight: 500;
}

.res-action-arrow {
    font-size: 0.75rem;
    color: #94A3B8;
    font-weight: 700;
    margin-left: auto;
    opacity: 0.7;
    transition: transform 0.15s ease;
}

.resource-link:hover .res-action-arrow {
    transform: translate(2px, -2px);
    opacity: 1;
    color: #012B5A;
}

.resource-link-locked {
    opacity: 0.85;
    background: #FFFBEB;
    border-color: #FEF3C7;
}

.resource-link-locked:hover {
    background: #FEF3C7;
    border-color: #FDE68A;
}

.res-lock-tag {
    font-size: 0.72rem;
    margin-left: auto;
}

.resources-empty-state {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.5rem;
    background: #F8FAFC;
    border-radius: 8px;
    font-size: 0.72rem;
    color: #94A3B8;
    line-height: 1.4;
}

.res-empty-icon {
    font-size: 1.1rem;
    opacity: 0.7;
}

.copyright-report-row {
    padding-top: 0.4rem;
}
.report-link {
    color: #94A3B8;
    font-size: 0.75rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.report-link:hover { color: #DC2626; }

/* ------------------------------------------------------------------------------
   PANE 2: CENTER STUDY LEARNING STAGE PANE
   ------------------------------------------------------------------------------ */
.study-stage-pane {
    flex-grow: 1;
    background: #F8FAFC;
    height: 100%;
    overflow-y: auto;
    padding: 0.75rem 1.75rem;
    display: flex;
    flex-direction: column;
    transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 0;
    box-sizing: border-box;
}

.stage-container {
    max-width: 880px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

/* Minimalist Single-Row Stage Control Bar (Zero Vertical Waste) */
.stage-control-bar-minimal {
    display: flex;
    flex-direction: column;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 0.4rem 0.85rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.control-bar-minimal-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    flex-wrap: wrap;
}

.step-header-left {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.stage-breadcrumb-strip {
    display: inline-flex;
    align-items: center;
}

.bc-deck {
    font-size: 0.76rem;
    font-weight: 700;
    color: #2563EB;
    background: #EFF6FF;
    border: 1px solid #DBEAFE;
    padding: 0.15rem 0.55rem;
    border-radius: 99px;
    white-space: nowrap;
}

.stage-main-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: #0F172A;
    line-height: 1.25;
    margin: 0;
}

.stage-meta-pills {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.74rem;
    font-weight: 600;
    flex-wrap: wrap;
}

.stage-pill {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    padding: 0.15rem 0.55rem;
    border-radius: 99px;
    color: #475569;
}

.stage-pill-xp {
    background: #FFFBEB;
    border-color: #FDE68A;
    color: #B45309;
}

.step-header-right-nav {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.stage-nav-btn {
    border: 1px solid #CBD5E1;
    background: #FFFFFF;
    color: #334155;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.35rem 0.85rem;
    border-radius: 99px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.stage-nav-btn:hover { background: #F1F5F9; }

/* Direct Interactive Step Tabs in Control Bar */
.stage-pagination-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.dot-indicators {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.step-tab-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.22rem 0.6rem;
    border-radius: 99px;
    font-size: 0.74rem;
    font-weight: 700;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s ease;
}
.step-tab-pill:hover {
    background: #F1F5F9;
    color: #0F172A;
}
.step-tab-pill.active {
    background: #2563EB;
    color: #FFFFFF;
    border-color: #2563EB;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

.step-dot {
    cursor: pointer;
}

.dot-text {
    font-size: 0.74rem;
    font-weight: 700;
    color: #64748B;
}




/* Step Views Visibility */
.study-step-view,
.step-panel {
    display: none;
}

.study-step-view.active,
.step-panel.active {
    display: block;
    animation: stageFadeIn 0.22s ease-out;
}

@keyframes stageFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.stage-card-body {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 18px;
    padding: 2rem;
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.04);
    box-sizing: border-box;
}

/* Quiz Stage Body (Matching user screenshot) */
.quiz-stage-body {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.quiz-type-badge {
    align-self: flex-start;
    font-size: 0.72rem;
    font-weight: 800;
    color: #64748B;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.quiz-stage-question {
    font-family: 'Outfit', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: #0F172A;
    line-height: 1.45;
}

.stage-options-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.stage-quiz-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1.25rem;
    border: 1.5px solid #E2E8F0;
    border-radius: 14px;
    background: #FFFFFF;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
}

.stage-quiz-option:hover {
    border-color: #93C5FD;
    background: #F8FAFC;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.06);
}

.stage-quiz-option.selected {
    border-color: #2563EB;
    background: #EFF6FF;
}

.stage-quiz-option.correct {
    border-color: #10B981;
    background: #ECFDF5;
}

.stage-quiz-option.incorrect {
    border-color: #EF4444;
    background: #FEF2F2;
}

.stage-opt-letter {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #F1F5F9;
    color: #475569;
    font-size: 0.85rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.stage-quiz-option.correct .stage-opt-letter {
    background: #10B981;
    color: #FFFFFF;
}

.stage-quiz-option.incorrect .stage-opt-letter {
    background: #EF4444;
    color: #FFFFFF;
}

.stage-opt-text {
    font-size: 0.92rem;
    font-weight: 500;
    color: #1E293B;
    flex-grow: 1;
}

.stage-remediation-box {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 1.25rem;
    animation: stageFadeIn 0.2s ease;
}

.remediation-header-row {
    font-weight: 800;
    font-size: 0.95rem;
    margin-bottom: 0.35rem;
}

.remediation-body-text {
    font-size: 0.9rem;
    color: #475569;
    line-height: 1.6;
}

/* Video Stage View */
.mock-video-player-wrap {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.mock-video-canvas {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.5rem;
    color: #FFFFFF;
    box-sizing: border-box;
}

.video-overlay-badge {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.6);
}

.video-center-cta {
    text-align: center;
    margin: auto 0;
}

.video-big-play {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    border: 2px solid #FFFFFF;
    color: #FFFFFF;
    font-size: 1.35rem;
    cursor: pointer;
    margin-bottom: 0.75rem;
    transition: transform 0.2s ease;
}
.video-big-play:hover { transform: scale(1.08); }

.video-hero-title {
    font-size: 1.15rem;
    font-weight: 700;
}

.video-stage-timeline {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.8rem;
}

.vid-track {
    flex-grow: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 99px;
    overflow: hidden;
}

.video-chapters-bar {
    padding-top: 1rem;
    border-top: 1px solid #E2E8F0;
}

.chapters-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #334155;
    margin-bottom: 0.65rem;
}

.chapters-chips-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.chapter-chip {
    background: #F1F5F9;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 0.35rem 0.65rem;
    font-size: 0.78rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.15s ease;
}
.chapter-chip:hover {
    background: #EFF6FF;
    border-color: #BFDBFE;
    color: #2563EB;
}
.chip-time { font-weight: 700; color: #2563EB; }

/* Notes Stage View */
.notes-stage-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #E2E8F0;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.notes-tag {
    font-size: 0.72rem;
    font-weight: 800;
    color: #2563EB;
}

.notes-highlighter-pills {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}
.hl-hint { font-size: 0.75rem; color: #64748B; }
.hl-swatch { width: 16px; height: 16px; border-radius: 50%; cursor: pointer; }
.swatch-yellow { background: #FACC15; }
.swatch-green { background: #4ADE80; }
.swatch-pink { background: #F472B6; }
.swatch-blue { background: #60A5FA; }

.notes-sub-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0F172A;
    margin-bottom: 0.75rem;
}

.formula-grid-display {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-bottom: 1.5rem;
}

.katex-item-card {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 0.85rem 1.25rem;
    text-align: center;
}

.formula-katex-text {
    font-family: 'KaTeX_Main', 'Cambria Math', serif;
    font-size: 1.25rem;
    color: #1D4ED8;
}

.keypoints-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-bottom: 1.5rem;
    padding: 0;
}

.kp-item {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.92rem;
    color: #334155;
    line-height: 1.6;
}

.exam-trap-banner {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.exam-trap-banner strong { color: #DC2626; display: block; margin-bottom: 0.25rem; }
.exam-trap-banner p { margin: 0; color: #991B1B; font-size: 0.88rem; line-height: 1.5; }

/* 3D Flashcard Stage */
.fc-stage-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.fc-due-badge {
    background: #EFF6FF;
    color: #2563EB;
    font-weight: 700;
    padding: 0.25rem 0.65rem;
    border-radius: 99px;
}

.fc-card-count { color: #64748B; }

.stage-flashcard-scene {
    width: 100%;
    min-height: 280px;
    perspective: 1200px;
    cursor: pointer;
    margin-bottom: 1.5rem;
}

.stage-flashcard-cube {
    width: 100%;
    min-height: 280px;
    position: relative;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

.stage-flashcard-cube.flipped { transform: rotateY(180deg); }

.stage-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 16px;
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border: 2px solid #E2E8F0;
    background: #FFFFFF;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
}

.stage-face.face-back {
    border-color: #10B981;
    transform: rotateY(180deg);
}

.face-badge {
    font-size: 0.72rem;
    font-weight: 800;
    color: #2563EB;
    letter-spacing: 0.05em;
}
.face-badge-green { color: #10B981; }

.face-body {
    margin: auto 0;
    text-align: center;
}

.face-prompt {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0F172A;
    line-height: 1.45;
}

.face-answer {
    font-size: 1.15rem;
    font-weight: 700;
    color: #0F172A;
    line-height: 1.5;
}

.face-hint-callout {
    margin-top: 0.75rem;
    background: #EFF6FF;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    color: #1E40AF;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.face-hint-prompt {
    font-size: 0.75rem;
    color: #94A3B8;
    text-align: center;
}

.stage-sm2-bar {
    padding-top: 1.25rem;
    border-top: 1px solid #E2E8F0;
}

.sm2-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: #475569;
    margin-bottom: 0.75rem;
    display: block;
}

.sm2-btn-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.sm2-btn {
    border: none;
    border-radius: 10px;
    padding: 0.75rem 0.5rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    transition: transform 0.15s ease;
}
.sm2-btn:hover { transform: translateY(-2px); }

.btn-again { background: #DC2626; color: #FFFFFF; }
.btn-hard { background: #EA580C; color: #FFFFFF; }
.btn-good { background: #2563EB; color: #FFFFFF; }
.btn-easy { background: #059669; color: #FFFFFF; }

/* ------------------------------------------------------------------------------
   PANE 3: ASK DECKZY AI COPILOT DRAWER (ANIMATED SLIDE-IN/OUT)
   ------------------------------------------------------------------------------ */
.ask-deckzy-drawer {
    width: 380px;
    flex-shrink: 0;
    background: #FFFFFF;
    border-left: 1px solid #E2E8F0;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: width 0.28s cubic-bezier(0.4, 0, 0.2, 1),
                margin 0.28s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.2s ease,
                right 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    box-sizing: border-box;
}

.ask-deckzy-drawer:not(.open) {
    width: 0 !important;
    margin-right: 0 !important;
    border-left: none !important;
    opacity: 0;
    pointer-events: none;
}

.deckzy-drawer-inner {
    width: 380px;
    height: 100%;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.deckzy-drawer-header {
    padding: 1rem 1.15rem;
    border-bottom: 1px solid #E2E8F0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #FFFFFF;
}

.deckzy-brand-status {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.deckzy-avatar-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #012B5A;
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    position: relative;
    flex-shrink: 0;
}

.status-pulse-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #10B981;
    border: 2px solid #FFFFFF;
    position: absolute;
    bottom: -1px;
    right: -1px;
}

.deckzy-title-wrap {
    display: flex;
    flex-direction: column;
}

.deckzy-name-row {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.deckzy-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 0.95rem;
    color: #0F172A;
}

.deckzy-model-tag {
    background: #F1F5F9;
    color: #475569;
    font-size: 0.62rem;
    font-weight: 700;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    letter-spacing: 0.04em;
}

.deckzy-status-sub {
    font-size: 0.72rem;
    color: #10B981;
    font-weight: 600;
}

.deckzy-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.deckzy-sparks-refill {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 99px;
    padding: 0.25rem 0.65rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: #92400E;
}

.refill-btn {
    color: #2563EB;
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.7rem;
}

.deckzy-close-btn {
    background: transparent;
    border: none;
    color: #64748B;
    font-size: 1.15rem;
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}
.deckzy-close-btn:hover { background: #F1F5F9; color: #0F172A; }

/* Grounding Reference Card */
.deckzy-grounding-card {
    padding: 0.85rem 1.15rem;
    background: #F8FAFC;
    border-bottom: 1px solid #E2E8F0;
}

.grounding-top-line {
    display: flex;
    justify-content: space-between;
    font-size: 0.68rem;
    font-weight: 800;
    color: #64748B;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.in-scope-badge {
    color: #2563EB;
    background: #EFF6FF;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
}

.grounding-step-name {
    font-size: 0.78rem;
    font-weight: 700;
    color: #1E293B;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Quick Action Chips */
.deckzy-quick-actions {
    padding: 0.85rem 1.15rem 0.4rem;
}

.quick-actions-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.68rem;
    font-weight: 800;
    color: #64748B;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.click-hint { font-weight: 500; color: #94A3B8; }

.quick-chips-column {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.quick-chip {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    color: #334155;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.quick-chip:hover {
    background: #EFF6FF;
    border-color: #BFDBFE;
    color: #1D4ED8;
    transform: translateX(2px);
}

.chip-icon { font-size: 0.85rem; flex-shrink: 0; }
.chip-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Chat Stream */
.deckzy-chat-stream {
    flex-grow: 1;
    overflow-y: auto;
    padding: 0.85rem 1.15rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.deckzy-msg-row {
    display: flex;
    gap: 0.65rem;
    align-items: flex-start;
}

.bot-avatar-mini {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #012B5A;
    color: #FFFFFF;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.bot-msg-bubble {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 0 14px 14px 14px;
    padding: 0.85rem 1rem;
    font-size: 0.82rem;
    line-height: 1.55;
    color: #1E293B;
    max-width: 90%;
}

.greeting-lead {
    margin-bottom: 0.4rem;
    color: #0F172A;
}

.greeting-body {
    margin-bottom: 0.6rem;
    color: #475569;
}

.bubble-spark-cost-note {
    padding-top: 0.5rem;
    border-top: 1px solid #E2E8F0;
    font-size: 0.7rem;
    color: #92400E;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.refill-link {
    color: #2563EB;
    font-weight: 700;
    text-decoration: none;
}

.deckzy-user-msg {
    justify-content: flex-end;
}

.user-msg-bubble {
    background: #2563EB;
    color: #FFFFFF;
    border-radius: 14px 0 14px 14px;
    padding: 0.75rem 1rem;
    font-size: 0.82rem;
    line-height: 1.5;
    max-width: 85%;
}

.deckzy-thinking .thinking-dots {
    color: #64748B;
    font-style: italic;
    font-size: 0.78rem;
}

/* Chat Prompt Input Container */
.deckzy-input-container {
    padding: 0.85rem 1.15rem 1rem;
    border-top: 1px solid #E2E8F0;
    background: #FFFFFF;
}

.deckzy-input-wrapper {
    display: flex;
    align-items: center;
    background: #F8FAFC;
    border: 1.5px solid #CBD5E1;
    border-radius: 10px;
    padding: 0.35rem 0.6rem;
    transition: border-color 0.15s ease;
}

.deckzy-input-wrapper:focus-within {
    border-color: #2563EB;
    background: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.deckzy-input-field {
    flex-grow: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.82rem;
    color: #0F172A;
    padding: 0.25rem;
}

.deckzy-send-btn {
    background: #012B5A;
    color: #FFFFFF;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    transition: background 0.15s ease;
}
.deckzy-send-btn:hover { background: #2563EB; }

.deckzy-input-footer {
    display: flex;
    justify-content: space-between;
    font-size: 0.68rem;
    color: #94A3B8;
    margin-top: 0.45rem;
}

/* ==============================================================================
   4. COMPREHENSIVE RESPONSIVE DESIGN (TABLETS & MOBILE SMARTPHONES)
   ============================================================================== */

/* Medium Laptops & Large Tablets (<= 1200px) */
@media (max-width: 1200px) {
    .curriculum-pane {
        width: 280px;
    }
    .ask-deckzy-drawer {
        width: 330px;
    }
    .deckzy-drawer-inner {
        width: 330px;
    }
    .study-stage-pane {
        padding: 1.25rem 1.5rem;
    }
}

/* Tablets (<= 992px) */
@media (max-width: 992px) {
    .mobile-header-toggle-btn {
        display: inline-flex;
    }

    /* Off-canvas Curriculum Drawer on Tablets */
    .curriculum-pane {
        position: fixed;
        left: -320px;
        top: 64px;
        bottom: 0;
        z-index: 150;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
        transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .curriculum-pane.mobile-open {
        left: 0;
    }

    /* Off-canvas Ask Deckzy Drawer on Tablets */
    .ask-deckzy-drawer {
        position: fixed;
        right: -380px;
        top: 64px;
        bottom: 0;
        z-index: 160;
        box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
        transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .ask-deckzy-drawer.open {
        right: 0 !important;
        width: 350px !important;
    }

    .ask-deckzy-drawer:not(.open) {
        right: -380px !important;
        width: 350px !important;
    }
}

/* Mobile Phones (<= 768px) */
@media (max-width: 768px) {
    /* Mobile Off-Canvas Left Sidebar: Slides in on toggle, occupies 0px screen space by default */
    .study-app-sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        bottom: 0;
        width: 250px;
        z-index: 1000;
        box-shadow: 0 0 35px rgba(0, 0, 0, 0.4);
        transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .study-app-sidebar.mobile-open {
        left: 0;
    }

    /* Collapse button hidden on mobile since sidebar is off-canvas */
    .sidebar-collapse-btn {
        display: none;
    }

    /* Header mobile adaptations */
    .study-top-header {
        height: 52px;
        padding: 0 0.65rem;
        gap: 0.4rem;
        overflow: hidden;
    }

    .header-left-group {
        gap: 0.35rem;
        flex-shrink: 1;
        min-width: 0;
    }

    .mobile-header-toggle-btn {
        display: flex !important;
        width: 34px;
        height: 34px;
        font-size: 1rem;
        border-radius: 8px;
        flex-shrink: 0;
    }

    .header-deck-indicator {
        max-width: 140px;
        padding: 0.25rem 0.55rem;
        gap: 0.35rem;
        flex-shrink: 1;
        min-width: 0;
    }

    .deck-indicator-title {
        font-size: 0.74rem;
    }

    .header-search-wrap {
        display: none !important; /* Fully remove search bar from deck study workspace */
    }

    .header-right-controls {
        gap: 0.35rem;
        margin-left: auto;
        flex-shrink: 0;
    }

    .board-context-pill,
    .header-institution-pill {
        display: none !important; /* Hide wide pills on mobile to eliminate overflow */
    }

    .header-badge-pill {
        height: 32px;
        padding: 0 0.55rem;
        font-size: 0.75rem;
    }

    .streak-pill {
        padding: 0 0.45rem;
    }

    .sparks-pill {
        padding: 0 0.55rem;
    }

    .sparks-pill .sparks-unit,
    .sparks-pill .sparks-plus {
        display: none !important;
    }

    .study-theme-toggle-btn {
        width: 32px;
        height: 32px;
        padding: 0 !important;
        border-radius: 50% !important;
        justify-content: center !important;
        flex-shrink: 0;
    }

    .study-theme-toggle-btn .theme-text {
        display: none !important;
    }

    .study-theme-toggle-btn .theme-icon {
        margin: 0;
        font-size: 0.88rem;
    }

    .header-unlock-cta-btn {
        height: 32px;
        padding: 0.3rem 0.65rem !important;
        font-size: 0.75rem !important;
        flex-shrink: 0;
    }

    .btn-ask-deckzy {
        height: 32px;
        padding: 0 0.65rem;
        font-size: 0.78rem;
        gap: 0.3rem;
        flex-shrink: 0;
    }

    .btn-ask-deckzy .deckzy-btn-label {
        display: none !important;
    }

    .btn-ask-deckzy .deckzy-btn-label-short {
        display: inline !important;
        font-size: 0.76rem;
        font-weight: 800;
    }

    /* Study Viewport */
    .study-content-viewport {
        height: calc(100vh - 56px);
    }

    .study-stage-pane {
        padding: 1rem 0.85rem;
    }

    .stage-card-body {
        padding: 1.25rem 1rem;
        border-radius: 14px;
    }

    .stage-main-title {
        font-size: 1.15rem;
    }

    .quiz-stage-question {
        font-size: 1rem;
    }

    .stage-quiz-option {
        padding: 0.75rem 0.85rem;
        gap: 0.65rem;
    }

    .stage-opt-text {
        font-size: 0.85rem;
    }

    .sm2-btn-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Full-screen bottom sheet / off-canvas Ask Deckzy on mobile */
    .ask-deckzy-drawer {
        position: fixed;
        right: -100vw;
        top: 0;
        bottom: 0;
        width: 100vw !important;
        max-width: 100vw;
        z-index: 1050;
        transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .ask-deckzy-drawer.open {
        right: 0 !important;
        width: 100vw !important;
    }

    .ask-deckzy-drawer:not(.open) {
        right: -100vw !important;
        width: 100vw !important;
    }

    .deckzy-drawer-inner {
        width: 100vw;
    }

    .curriculum-pane {
        width: 85vw;
        left: -85vw;
    }

    .curriculum-pane.mobile-open {
        left: 0;
    }
}

/* Extra Small Mobile Screens (<= 480px) */
@media (max-width: 480px) {
    .study-top-header {
        padding: 0 0.45rem;
        gap: 0.25rem;
    }

    .header-left-group {
        gap: 0.25rem;
    }

    .header-deck-indicator {
        display: none !important;
    }

    .streak-pill {
        display: none !important;
    }

    .header-right-controls {
        gap: 0.25rem;
    }

    .sparks-pill {
        padding: 0 0.4rem;
        font-size: 0.72rem;
    }

    .btn-ask-deckzy {
        padding: 0 0.5rem;
    }
}

/* ==============================================================================
   TASK-302: VIDEO PLAYER, CHAPTER BOOKMARKS & SYNCHRONIZED TRANSCRIPT
   ============================================================================== */

.video-card-body {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1.75rem;
}

.video-stage-top-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.video-meta-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.video-step-tag {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    text-transform: uppercase;
}

.video-provider-badge {
    font-size: 0.75rem;
    font-weight: 600;
    color: #475569;
    background: #F1F5F9;
    padding: 0.3rem 0.65rem;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-claim-video-xp {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
    color: #FFFFFF;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.55rem 1.15rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-claim-video-xp:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
}

.btn-claim-video-xp.completed {
    background: #10B981 !important;
    border-color: #059669 !important;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25);
}

.video-viewport-wrapper {
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    background: #030D1B;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
}

.video-aspect-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    background: #020813;
}

.embedded-player-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    object-fit: cover;
}

/* Video Stage Hud Controls */
.video-stage-hud {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(2, 6, 23, 0.88) 100%);
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.25rem;
    z-index: 10;
    color: #FFFFFF;
}

.hud-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.hud-btn {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #FFFFFF;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.hud-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

.hud-btn.btn-speed {
    width: auto;
    padding: 0 0.65rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.75rem;
}

.hud-timestamp {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    color: #E2E8F0;
    letter-spacing: 0.04em;
}

.hud-center {
    flex: 1;
}

.video-progress-scrubber {
    position: relative;
    height: 14px;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.scrubber-track {
    position: relative;
    width: 100%;
    height: 5px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 9999px;
    overflow: visible;
}

.scrubber-fill {
    height: 100%;
    border-radius: 9999px;
    transition: width 0.1s linear;
}

.scrubber-thumb {
    position: absolute;
    top: 50%;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #FFFFFF;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.4);
    transform: translate(-50%, -50%);
    pointer-events: none;
    transition: left 0.1s linear;
}

.hud-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Split Grid: Chapters & Transcript */
.video-interactive-split-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 0.5rem;
}

.video-chapters-panel,
.video-transcript-panel {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 16px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.panel-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.panel-heading {
    margin: 0;
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: #0F172A;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chapters-count-badge {
    font-size: 0.72rem;
    font-weight: 700;
    color: #64748B;
    background: #E2E8F0;
    padding: 0.2rem 0.55rem;
    border-radius: 9999px;
}

.chapters-interactive-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    max-height: 320px;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.chapter-item-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 0.75rem 0.9rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.chapter-item-card:hover {
    border-color: #93C5FD;
    background: #F0F7FF;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.06);
}

.chapter-item-card.active {
    border-color: #2563EB;
    background: #EFF6FF;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.1);
}

.chapter-time-pill {
    padding: 0.25rem 0.55rem;
    border-radius: 8px;
    background: #F1F5F9;
    border: 1.5px solid transparent;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    font-weight: 700;
    color: #1E293B;
    flex-shrink: 0;
}

.chapter-item-card.active .chapter-time-pill {
    background: #2563EB;
    color: #FFFFFF;
    border-color: #2563EB;
}

.chapter-details {
    flex: 1;
    min-width: 0;
}

.chapter-title {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 700;
    color: #0F172A;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chapter-summary {
    margin: 0.2rem 0 0 0;
    font-size: 0.72rem;
    color: #64748B;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.chapter-play-indicator {
    color: #94A3B8;
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}

.chapter-item-card:hover .chapter-play-indicator {
    color: #2563EB;
    transform: translateX(2px);
}

/* Transcript Panel Compact Search Wrap */
.transcript-search-wrap {
    display: inline-flex;
    align-items: center;
    background: #F8FAFC;
    border: 1px solid #CBD5E1;
    border-radius: 99px;
    padding: 0 0.55rem;
    gap: 0.35rem;
    width: 125px;
    height: 28px;
    box-sizing: border-box;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.transcript-search-wrap:focus-within {
    border-color: #2563EB;
    background: #FFFFFF;
    width: 160px;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.transcript-search-wrap .ts-search-icon {
    font-size: 0.7rem;
    color: #94A3B8;
    line-height: 1;
    flex-shrink: 0;
    user-select: none;
}

/* Explicit reset overriding universal input styles from app.css */
.transcript-search-wrap input.transcript-search-input,
.transcript-search-wrap input[type="text"],
input.transcript-search-input {
    border: none !important;
    outline: none !important;
    background: transparent !important;
    background-color: transparent !important;
    padding: 0 0.15rem !important;
    margin: 0 !important;
    font-size: 0.74rem !important;
    line-height: 1.2 !important;
    height: 100% !important;
    min-height: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    color: #0F172A !important;
    width: 100% !important;
}

.transcript-search-wrap input.transcript-search-input:focus,
.transcript-search-wrap input[type="text"]:focus,
.transcript-search-wrap input.transcript-search-input:hover,
.transcript-search-wrap input[type="text"]:hover {
    border: none !important;
    outline: none !important;
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
}

.transcript-scroll-stream {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    max-height: 320px;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.transcript-line-cue {
    display: flex;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.transcript-line-cue:hover {
    background: #F8FAFC;
    border-color: #93C5FD;
}

.transcript-line-cue.active {
    background: #EFF6FF;
    border-color: #2563EB;
    box-shadow: 0 2px 10px rgba(37, 99, 235, 0.08);
}

.transcript-line-cue.search-match {
    border-color: #F59E0B;
    background: #FFFBEB;
}

.cue-left-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    flex-shrink: 0;
    width: 65px;
}

.cue-time-stamp {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    font-weight: 700;
    color: #2563EB;
    background: rgba(37, 99, 235, 0.08);
    padding: 0.15rem 0.35rem;
    border-radius: 6px;
}

.cue-speaker {
    font-size: 0.68rem;
    font-weight: 700;
    color: #64748B;
}

.cue-body-text {
    flex: 1;
}

.cue-content {
    margin: 0;
    font-size: 0.82rem;
    color: #334155;
    line-height: 1.45;
}

.transcript-line-cue.active .cue-content {
    color: #0F172A;
    font-weight: 600;
}

/* Video XP Toast */
.video-xp-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 2000;
    animation: toastSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes toastSlideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.toast-content-box {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #0F172A;
    color: #FFFFFF;
    padding: 1rem 1.4rem;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.3);
}

.toast-sparkle {
    font-size: 1.6rem;
}

.toast-text-group {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.toast-text-group strong {
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    color: #10B981;
}

.toast-text-group span {
    font-size: 0.8rem;
    color: #CBD5E1;
}

/* ==============================================================================
   TASK-303: LATEX CONCEPT NOTES & 5 PEDAGOGICAL HIGHLIGHTERS
   ============================================================================== */

.notes-card-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 0.75rem 1rem 2rem 1rem;
    max-width: 920px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

/* Compact Space-Optimized Notes Reading Toolbar */
.notes-stage-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.35rem 0.65rem;
    min-height: 38px;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    box-sizing: border-box;
}

.notes-toolbar-left {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: nowrap;
}

.notes-tag {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    padding: 0.22rem 0.55rem;
    border-radius: 9999px;
    text-transform: uppercase;
}

.notes-read-time {
    font-size: 0.72rem;
    font-weight: 600;
    color: #64748B;
    background: #F1F5F9;
    padding: 0.2rem 0.45rem;
    border-radius: 6px;
}

/* Unified Connected Audio Control Group */
.audio-control-group {
    display: inline-flex;
    align-items: center;
    border-radius: 99px;
    background: #F1F5F9;
    border: 1px solid #CBD5E1;
    overflow: hidden;
    height: 28px;
    box-sizing: border-box;
}

.btn-listen-notes {
    height: 100%;
    padding: 0 0.65rem 0 0.6rem;
    font-size: 0.74rem;
    font-weight: 700;
    color: #1E293B;
    background: transparent;
    border: none;
    border-right: 1px solid #CBD5E1;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.btn-listen-notes:hover {
    background: #E2E8F0;
    color: #0F172A;
}

.btn-audio-settings {
    height: 100%;
    width: 28px;
    padding: 0;
    font-size: 0.75rem;
    color: #64748B;
    background: transparent;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-audio-settings:hover {
    background: #E2E8F0;
    color: #0F172A;
}

.notes-toolbar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.highlights-count-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: #F1F5F9;
    border: 1px solid #CBD5E1;
    padding: 0 0.6rem;
    height: 28px;
    border-radius: 9999px;
    font-size: 0.74rem;
    font-weight: 700;
    color: #334155;
    box-sizing: border-box;
    transition: all 0.15s ease;
}

.highlights-count-pill:hover {
    background: #E2E8F0;
    color: #0F172A;
}


/* Floating Highlight Popover */
.floating-hl-popover {
    position: fixed;
    z-index: 999999;
    background: #0F172A;
    border-radius: 9999px;
    padding: 0.35rem 0.65rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: popoverFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popoverFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.popover-btn {
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.15s ease;
    user-select: none;
}

.popover-btn:hover {
    transform: scale(1.2);
}

.popover-divider {
    width: 1px;
    height: 16px;
    background: rgba(255, 255, 255, 0.2);
}

.hl-add-note-btn {
    font-size: 0.75rem;
    font-weight: 700;
    color: #FFFFFF;
    padding: 0.15rem 0.45rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.12);
}

.hl-add-note-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.hl-dict-btn {
    font-size: 0.75rem;
    font-weight: 700;
    color: #38BDF8;
    padding: 0.15rem 0.45rem;
    border-radius: 6px;
    background: rgba(56, 189, 248, 0.15);
    display: inline-flex;
    align-items: center;
    gap: 3px;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.hl-dict-btn:hover {
    background: rgba(56, 189, 248, 0.3);
    color: #FFFFFF;
    transform: scale(1.05);
}

/* Educational Dictionary Modal */
.dict-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(6px);
    z-index: 1600;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.dict-modal-card {
    background: #FFFFFF;
    border-radius: 18px;
    width: 100%;
    max-width: 520px;
    max-height: 85vh;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalScaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.dict-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.15rem 1.4rem;
    background: #F8FAFC;
    border-bottom: 1px solid #E2E8F0;
}

.dict-header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dict-icon {
    font-size: 1.25rem;
}

.dict-header-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: #0F172A;
}

.dict-modal-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #64748B;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 6px;
    transition: color 0.15s ease, background 0.15s ease;
}

.dict-modal-close:hover {
    color: #0F172A;
    background: #E2E8F0;
}

.dict-modal-body {
    padding: 1.25rem 1.4rem;
    overflow-y: auto;
    max-height: calc(85vh - 140px);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.dict-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.4rem;
    background: #F8FAFC;
    border-top: 1px solid #E2E8F0;
}

.btn-dict-cancel {
    padding: 0.55rem 1rem;
    border-radius: 8px;
    border: 1px solid #CBD5E1;
    background: #FFFFFF;
    color: #475569;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}

.btn-dict-cancel:hover {
    background: #F1F5F9;
}

.btn-dict-save-def {
    padding: 0.55rem 1.15rem;
    border-radius: 8px;
    border: none;
    background: #16A34A;
    color: #FFFFFF;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(22, 163, 74, 0.3);
    transition: background 0.15s ease, transform 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-dict-save-def:hover {
    background: #15803D;
    transform: translateY(-1px);
}

.dict-word-banner {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1.5px solid #F1F5F9;
}

.dict-word-head {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
}

.dict-word-text {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    color: #0F172A;
    text-transform: capitalize;
}

.dict-phonetic-badge {
    font-family: 'Roboto Mono', monospace;
    font-size: 0.85rem;
    color: #6366F1;
    background: rgba(99, 102, 241, 0.08);
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    font-weight: 600;
}

.dict-pronounce-btn {
    border: 1px solid #CBD5E1;
    background: #FFFFFF;
    border-radius: 8px;
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #2563EB;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.15s ease;
}

.dict-pronounce-btn:hover {
    background: #EFF6FF;
    border-color: #2563EB;
}

.dict-meaning-group {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.dict-pos-tag {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #475569;
    background: #F1F5F9;
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
    width: fit-content;
}

.dict-def-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.dict-def-item {
    font-size: 0.9rem;
    color: #334155;
    line-height: 1.5;
    display: flex;
    gap: 0.5rem;
}

.dict-def-num {
    font-weight: 700;
    color: #94A3B8;
    min-width: 16px;
}

.dict-def-content {
    flex: 1;
}

.dict-example {
    margin-top: 0.25rem;
    font-style: italic;
    font-size: 0.82rem;
    color: #64748B;
    border-left: 2px solid #CBD5E1;
    padding-left: 0.5rem;
}

.dict-loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1rem;
    gap: 1rem;
    text-align: center;
}

.dict-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #E2E8F0;
    border-top-color: #2563EB;
    border-radius: 50%;
    animation: dictSpin 0.75s linear infinite;
}

@keyframes dictSpin {
    to { transform: rotate(360deg); }
}

.dict-loading-text {
    font-size: 0.9rem;
    color: #64748B;
}

.dict-not-found {
    text-align: center;
    padding: 1.5rem 0.5rem;
}

.dict-nf-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.dict-nf-title {
    font-weight: 700;
    font-size: 1.05rem;
    color: #0F172A;
    margin-bottom: 0.35rem;
}

.dict-nf-msg {
    font-size: 0.85rem;
    color: #64748B;
    margin-bottom: 1rem;
}

.dict-nf-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.dict-ext-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: #2563EB;
    background: #EFF6FF;
    border: 1px solid #BFDBFE;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.15s ease;
}

.dict-ext-link:hover {
    background: #DBEAFE;
    text-decoration: none;
}

/* 5 Pedagogical Highlighters */
.vidyoric-highlight {
    border-radius: 3px;
    padding: 1px 3px;
    cursor: pointer;
    transition: filter 0.15s ease;
}

.vidyoric-highlight:hover {
    filter: brightness(0.92);
}

/* Yellow: Key concepts */
.vidyoric-highlight.hl-yellow, mark.hl-yellow {
    background-color: #FEF08A;
    color: #854D0E;
    border-bottom: 2px solid #EAB308;
}

/* Green: Definitions */
.vidyoric-highlight.hl-green, mark.hl-green {
    background-color: #BBF7D0;
    color: #166534;
    border-bottom: 2px solid #22C55E;
}

/* Pink: Exam Traps */
.vidyoric-highlight.hl-pink, mark.hl-pink {
    background-color: #FBCFE8;
    color: #9D174D;
    border-bottom: 2px solid #EC4899;
}

/* Blue: Examples */
.vidyoric-highlight.hl-blue, mark.hl-blue {
    background-color: #BAE6FD;
    color: #075985;
    border-bottom: 2px solid #0EA5E9;
}

/* Purple: Formulas */
.vidyoric-highlight.hl-purple, mark.hl-purple {
    background-color: #E9D5FF;
    color: #6B21A8;
    border-bottom: 2px solid #A855F7;
}

/* Margin Note Modal */
.margin-note-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-card {
    background: #FFFFFF;
    border-radius: 18px;
    width: 100%;
    max-width: 480px;
    padding: 1.5rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    animation: modalScaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScaleUp {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: #0F172A;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.1rem;
    color: #64748B;
    cursor: pointer;
    padding: 0.25rem;
}

.modal-close:hover {
    color: #0F172A;
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.modal-text-preview {
    margin: 0;
    padding: 0.65rem 0.85rem;
    background: #F8FAFC;
    border-left: 3px solid #2563EB;
    border-radius: 6px;
    font-size: 0.82rem;
    color: #475569;
    font-style: italic;
    max-height: 80px;
    overflow-y: auto;
}

.modal-note-textarea {
    width: 100%;
    min-height: 90px;
    border: 1.5px solid #CBD5E1;
    border-radius: 10px;
    padding: 0.75rem;
    font-size: 0.85rem;
    font-family: 'Inter', sans-serif;
    color: #0F172A;
    box-sizing: border-box;
    outline: none;
    resize: vertical;
}

.modal-note-textarea:focus {
    border-color: #2563EB;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.5rem;
}

.btn-delete-hl {
    background: none;
    border: 1px solid #FCA5A5;
    color: #DC2626;
    padding: 0.55rem 0.95rem;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-delete-hl:hover {
    background: #FEF2F2;
    border-color: #EF4444;
}

.btn-save-note {
    background: #2563EB;
    color: #FFFFFF;
    border: none;
    padding: 0.55rem 1.25rem;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-save-note:hover {
    background: #1D4ED8;
}

/* Student Notes & Highlights Drawer Panel */
.student-notes-panel {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 14px;
    margin-bottom: 1rem;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.notes-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: #F8FAFC;
    border-bottom: 1px solid #F1F5F9;
    user-select: none;
}

.panel-header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.panel-icon {
    font-size: 1.1rem;
}

.panel-title {
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    color: #0F172A;
    margin: 0;
}

.panel-badge {
    font-size: 0.72rem;
    font-weight: 700;
    background: #EFF6FF;
    color: #2563EB;
    padding: 0.15rem 0.55rem;
    border-radius: 99px;
    border: 1px solid #BFDBFE;
}

.btn-toggle-notes-tray {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: #FFFFFF;
    border: 1px solid #CBD5E1;
    color: #475569;
    font-size: 0.76rem;
    font-weight: 600;
    padding: 0.25rem 0.65rem;
    border-radius: 99px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.btn-toggle-notes-tray:hover {
    background: #F1F5F9;
    color: #0F172A;
}

.notes-panel-body {
    padding: 0.85rem 1rem;
    background: #FFFFFF;
}

.notes-empty-state {
    font-size: 0.84rem;
    color: #64748B;
    line-height: 1.5;
    padding: 0.5rem 0;
}

.student-notes-cards-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.student-note-card {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-left: 4px solid #F59E0B;
    border-radius: 10px;
    padding: 0.75rem 0.95rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    transition: all 0.15s ease;
}
.student-note-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}
.student-note-card.border-hl-yellow { border-left-color: #EAB308; }
.student-note-card.border-hl-green { border-left-color: #10B981; }
.student-note-card.border-hl-pink { border-left-color: #EC4899; }
.student-note-card.border-hl-blue { border-left-color: #3B82F6; }
.student-note-card.border-hl-purple { border-left-color: #A855F7; }

.note-card-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.note-type-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.12rem 0.5rem;
    border-radius: 99px;
}
.hl-badge-yellow { background: #FEF08A; color: #854D0E; }
.hl-badge-green { background: #BBF7D0; color: #166534; }
.hl-badge-pink { background: #FCE7F3; color: #9D174D; }
.hl-badge-blue { background: #DBEAFE; color: #1E40AF; }
.hl-badge-purple { background: #F3E8FF; color: #6B21A8; }

.note-card-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.btn-card-action {
    background: #FFFFFF;
    border: 1px solid #CBD5E1;
    color: #475569;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.btn-card-action:hover {
    background: #F1F5F9;
    color: #0F172A;
}

.btn-card-delete {
    color: #EF4444;
    padding: 0.2rem 0.35rem;
}
.btn-card-delete:hover {
    background: #FEE2E2;
    border-color: #FCA5A5;
}

.note-card-quote {
    margin: 0;
    font-size: 0.85rem;
    color: #1E293B;
    font-style: italic;
    background: rgba(255, 255, 255, 0.7);
    padding: 0.4rem 0.65rem;
    border-radius: 6px;
    border-left: 2px solid #CBD5E1;
}

.note-card-user-note {
    font-size: 0.84rem;
    color: #0F172A;
    background: #EFF6FF;
    border: 1px solid #BFDBFE;
    border-radius: 6px;
    padding: 0.45rem 0.65rem;
    line-height: 1.45;
}

.hl-pulse-focus {
    outline: 3px solid #2563EB;
    outline-offset: 2px;
    animation: hlPulseGlow 1.5s ease;
}

@keyframes hlPulseGlow {
    0% { outline-color: #2563EB; box-shadow: 0 0 14px rgba(37, 99, 235, 0.6); }
    50% { outline-color: #9333EA; box-shadow: 0 0 20px rgba(147, 51, 234, 0.8); }
    100% { outline-color: transparent; box-shadow: none; }
}

/* Formula & Notes Display */
.notes-formula-box {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 16px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.box-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.notes-sub-title {
    margin: 0;
    font-family: 'Outfit', sans-serif;
    font-size: 0.98rem;
    font-weight: 700;
    color: #0F172A;
}

.box-badge {
    font-size: 0.68rem;
    font-weight: 700;
    color: #2563EB;
    background: rgba(37, 99, 235, 0.08);
    padding: 0.2rem 0.5rem;
    border-radius: 9999px;
}

.formula-grid-display {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.katex-item-card {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 0.85rem 1rem;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.02);
}

.formula-katex-text {
    font-size: 1.05rem;
    color: #0F172A;
    overflow-x: auto;
    padding: 0.25rem 0;
}

.notes-keypoints-box {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.keypoints-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.kp-item {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 0.85rem 1rem;
}

.kp-icon {
    font-size: 0.9rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.kp-text {
    font-size: 0.88rem;
    color: #334155;
    line-height: 1.55;
}

.exam-trap-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    background: #FFFBEB;
    border: 1.5px solid #FDE68A;
    border-radius: 14px;
    padding: 1rem 1.25rem;
}

.trap-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.trap-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.trap-title {
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    color: #92400E;
}

.trap-desc {
    margin: 0;
    font-size: 0.82rem;
    color: #78350F;
    line-height: 1.5;
}

/* ==============================================================================
   RECREATED MODERN NOTES CANVAS & TYPOGRAPHY STYLES
   ============================================================================== */

.notes-reading-canvas {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 16px;
    padding: 2rem 2.5rem;
    box-shadow: 0 4px 20px -2px rgba(1, 43, 90, 0.05);
    color: #1E293B;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.68;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .notes-reading-canvas {
        padding: 1.25rem 1rem;
        border-radius: 12px;
    }
}

.notes-h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.45rem;
    font-weight: 800;
    color: #012B5A;
    margin: 1.4rem 0 0.55rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid #F1F5F9;
    letter-spacing: -0.01em;
}

.notes-h2:first-child {
    margin-top: 0;
}

.notes-h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 800;
    color: #012B5A;
    margin: 1.35rem 0 0.45rem;
    letter-spacing: -0.01em;
}

.notes-h3:first-child {
    margin-top: 0;
}

.notes-h4 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.08rem;
    font-weight: 700;
    color: #0E3666;
    margin: 1.15rem 0 0.35rem;
}

.notes-h5 {
    font-size: 0.95rem;
    font-weight: 700;
    color: #334155;
    margin: 1rem 0 0.3rem;
}

.notes-p {
    font-size: 0.96rem;
    line-height: 1.68;
    color: #334155;
    margin: 0 0 0.85rem;
}

.notes-p:last-child {
    margin-bottom: 0;
}

.notes-ul, .notes-ol {
    margin: 0.25rem 0 1rem 0;
    padding-left: 1.4rem;
    color: #334155;
}

.notes-ul li, .notes-ol li {
    margin: 0.3rem 0;
    line-height: 1.62;
    font-size: 0.95rem;
}

.notes-divider {
    border: none;
    height: 1px;
    background: #E2E8F0;
    margin: 1.5rem 0;
}

.notes-math-display {
    background: linear-gradient(135deg, #F8FAFC 0%, #F1F5F9 100%);
    border: 1px solid #E2E8F0;
    border-left: 4px solid #2563EB;
    border-radius: 10px;
    padding: 0.85rem 1.25rem;
    margin: 0.9rem 0;
    overflow-x: auto;
    font-size: 1.08rem;
    color: #0F172A;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.notes-callout {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    border-radius: 12px;
    padding: 0.85rem 1.15rem;
    margin: 1rem 0;
    font-size: 0.92rem;
    line-height: 1.6;
}

.notes-callout .callout-icon {
    font-size: 1.2rem;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.notes-callout .callout-content {
    flex: 1;
}

.notes-callout-warning {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-left: 4px solid #D97706;
    color: #92400E;
}

.notes-callout-tip {
    background: #F0FDF4;
    border: 1px solid #BBF7D0;
    border-left: 4px solid #16A34A;
    color: #166534;
}

.notes-callout-formula {
    background: #FAF5FF;
    border: 1px solid #E9D5FF;
    border-left: 4px solid #9333EA;
    color: #6B21A8;
}

.notes-blockquote {
    background: #F8FAFC;
    border-left: 4px solid #94A3B8;
    border-radius: 0 8px 8px 0;
    padding: 0.75rem 1rem;
    margin: 0.9rem 0;
    color: #475569;
    font-style: italic;
    font-size: 0.92rem;
    line-height: 1.6;
}

.notes-table-wrap {
    overflow-x: auto;
    margin: 1.15rem 0;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    background: #FFFFFF;
}

.notes-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}

.notes-table th {
    background: #F8FAFC;
    color: #012B5A;
    font-weight: 700;
    padding: 0.7rem 1rem;
    border-bottom: 1.5px solid #CBD5E1;
}

.notes-table td {
    padding: 0.65rem 1rem;
    border-bottom: 1px solid #F1F5F9;
    color: #334155;
}

.notes-table tr:last-child td {
    border-bottom: none;
}

.notes-inline-code {
    background: #F1F5F9;
    color: #0F172A;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.86em;
    padding: 0.15em 0.4em;
    border-radius: 5px;
    border: 1px solid #E2E8F0;
}

.notes-code-box {
    background: #0F172A;
    border-radius: 12px;
    margin: 1.2rem 0;
    overflow: hidden;
}

.notes-code-lang {
    background: #1E293B;
    color: #94A3B8;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.35rem 1rem;
    letter-spacing: 0.05em;
}

.notes-code-pre {
    margin: 0;
    padding: 1rem 1.25rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: #F8FAFC;
    overflow-x: auto;
}

/* ==============================================================================
   TASK-303 ENHANCEMENT: NOTES DIAGRAMS, FIGURES & IMAGE ATTACHMENTS
   ============================================================================== */

/* Button to add visual note in toolbar */
.btn-add-visual-note {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: #EFF6FF;
    border: 1px solid #BFDBFE;
    color: #1D4ED8;
    height: 28px;
    padding: 0 0.65rem;
    border-radius: 9999px;
    font-size: 0.74rem;
    font-weight: 700;
    cursor: pointer;
    box-sizing: border-box;
    white-space: nowrap;
    transition: all 0.15s ease;
}
.btn-add-visual-note:hover {
    background: #DBEAFE;
    border-color: #93C5FD;
    color: #1E40AF;
}

/* Notes Diagrams & Figures Box */
.notes-diagrams-box {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 16px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.diagrams-grid-display {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.notes-diagram-card {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 14px;
    padding: 1.15rem;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.notes-diagram-card:hover {
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.08);
}

.diagram-card-top {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.diagram-badge {
    font-size: 0.72rem;
    font-weight: 700;
    color: #2563EB;
    background: #EFF6FF;
    border: 1px solid #BFDBFE;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
}

.diagram-title {
    margin: 0;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: #0F172A;
}

.diagram-visual-viewport {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: zoom-in;
    background: #0B132B;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    border: 1px solid #1E293B;
}

.diagram-svg-wrap {
    width: 100%;
    display: flex;
    justify-content: center;
}

.diagram-svg-wrap svg {
    max-height: 380px;
    width: 100%;
    height: auto;
}

.diagram-img {
    max-width: 100%;
    max-height: 380px;
    object-fit: contain;
    display: block;
    border-radius: 10px;
}

.diagram-zoom-pill {
    position: absolute;
    bottom: 0.75rem;
    right: 0.75rem;
    background: rgba(15, 23, 42, 0.8);
    color: #F8FAFC;
    backdrop-filter: blur(4px);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.diagram-visual-viewport:hover .diagram-zoom-pill {
    background: #2563EB;
    transform: scale(1.05);
}

.diagram-caption {
    margin: 0;
    font-size: 0.86rem;
    color: #475569;
    line-height: 1.6;
    background: #F8FAFC;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border-left: 3px solid #2563EB;
}

/* Modal Image Attachment Section inside highlightMarginModal */
.modal-image-attachment-section {
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    border-top: 1px dashed #E2E8F0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.modal-section-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: #475569;
}

.modal-image-inputs-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.modal-image-inputs-row input[type="text"] {
    flex: 1;
    font-size: 0.82rem;
    padding: 0.45rem 0.75rem;
    border: 1px solid #CBD5E1;
    border-radius: 8px;
    outline: none;
}
.modal-image-inputs-row input[type="text"]:focus {
    border-color: #2563EB;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.btn-file-upload-label {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: #F1F5F9;
    border: 1px solid #CBD5E1;
    color: #334155;
    padding: 0.45rem 0.75rem;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease;
}
.btn-file-upload-label:hover {
    background: #E2E8F0;
    color: #0F172A;
}

.modal-img-preview-box {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    border: 1px solid #CBD5E1;
    border-radius: 8px;
    padding: 0.35rem;
    background: #F8FAFC;
    max-width: fit-content;
}

.modal-img-preview-box img {
    max-height: 90px;
    max-width: 220px;
    border-radius: 6px;
    object-fit: cover;
}

.btn-remove-preview {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #EF4444;
    color: #FFFFFF;
    border: none;
    font-size: 0.7rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Note Card Attached Image in Student Notes Tray */
.note-card-image-wrap {
    margin-top: 0.5rem;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    cursor: zoom-in;
    border: 1.5px solid #CBD5E1;
    background: #0F172A;
    width: fit-content;
    max-width: 140px;
    height: 72px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.note-card-image-wrap:hover {
    transform: translateY(-1px) scale(1.02);
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.note-card-image {
    width: 140px;
    height: 72px;
    object-fit: cover;
    display: block;
}

.note-card-image-hint {
    position: absolute;
    bottom: 0.25rem;
    right: 0.25rem;
    background: rgba(15, 23, 42, 0.85);
    color: #FFFFFF;
    font-size: 0.62rem;
    font-weight: 600;
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    gap: 3px;
    pointer-events: none;
}

/* Lightbox Fullscreen Modal */
.notes-image-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(8px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    box-sizing: border-box;
}

.lightbox-dialog {
    background: #1E293B;
    border: 1px solid #334155;
    border-radius: 16px;
    max-width: 920px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.lightbox-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid #334155;
    background: #0F172A;
}

.lightbox-title {
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: #F8FAFC;
}

.lightbox-close-btn {
    background: transparent;
    border: none;
    color: #94A3B8;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    transition: color 0.15s ease, background 0.15s ease;
}
.lightbox-close-btn:hover {
    color: #FFFFFF;
    background: #334155;
}

.lightbox-body {
    padding: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    background: #0B132B;
    max-height: 65vh;
}

.lightbox-body img {
    max-width: 100%;
    max-height: 60vh;
    object-fit: contain;
}

.lightbox-svg-container {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-svg-container svg {
    max-width: 100%;
    max-height: 60vh;
    height: auto;
}

.lightbox-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid #334155;
    background: #0F172A;
    font-size: 0.82rem;
    color: #CBD5E1;
    line-height: 1.5;
}

@media (max-width: 992px) {
    .video-interactive-split-grid {
        grid-template-columns: 1fr;
    }
}

/* ==============================================================================
   TASK-401 & TASK-402: 3D FLIP FLASHCARD COMPONENT & SM-2 ACTIVE RECALL
   ============================================================================== */

.flashcard-card-body {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1.75rem;
}

.fc-stage-meta-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.fc-meta-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.fc-due-badge {
    font-size: 0.75rem;
    font-weight: 700;
    color: #4F46E5;
    background: #EEF2FF;
    border: 1px solid #C7D2FE;
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
}

.fc-card-count {
    font-size: 0.78rem;
    font-weight: 700;
    color: #64748B;
}

.btn-star-card {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: #FFFFFF;
    border: 1.5px solid #E2E8F0;
    padding: 0.4rem 0.85rem;
    border-radius: 10px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-star-card:hover {
    border-color: #FBBF24;
    background: #FFFBEB;
    color: #D97706;
}

.btn-star-card.bookmarked {
    background: #FFFBEB;
    border-color: #F59E0B;
    color: #D97706;
}

.btn-star-card.bookmarked .star-icon {
    color: #F59E0B;
}

/* 3D Perspective Flashcard Cube */
.stage-flashcard-scene {
    perspective: 1200px;
    width: 100%;
    min-height: 380px;
    cursor: pointer;
}

.stage-flashcard-cube {
    position: relative;
    width: 100%;
    min-height: 380px;
    transform-style: preserve-3d;
    transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 20px;
}

.stage-flashcard-cube.flipped {
    transform: rotateY(180deg);
}

.stage-face {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 20px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
    border: 1.5px solid #E2E8F0;
}

.face-front {
    background: linear-gradient(135deg, #FFFFFF 0%, #F8FAFC 100%);
    z-index: 2;
}

.face-back {
    background: linear-gradient(135deg, #F0FDF4 0%, #FFFFFF 100%);
    border-color: #BBF7D0;
    transform: rotateY(180deg);
}

.face-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.face-badge {
    font-size: 0.72rem;
    font-weight: 800;
    color: #2563EB;
    background: rgba(37, 99, 235, 0.1);
    padding: 0.3rem 0.65rem;
    border-radius: 6px;
    letter-spacing: 0.05em;
}

.face-badge-green {
    color: #059669;
    background: rgba(16, 185, 129, 0.12);
}

.face-keyboard-hint {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    color: #94A3B8;
    background: #F1F5F9;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
}

.face-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.25rem;
    padding: 1.5rem 0;
}

.face-prompt {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #0F172A;
    line-height: 1.55;
}

.face-answer {
    font-size: 1.05rem;
    color: #1E293B;
    line-height: 1.6;
}

.face-hint-container {
    align-self: flex-start;
}

.btn-hint-toggle {
    background: #FEF3C7;
    border: 1px solid #FDE68A;
    color: #92400E;
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-hint-toggle:hover {
    background: #FDE68A;
}

.face-hint-text {
    margin-top: 0.5rem;
    padding: 0.65rem 0.85rem;
    background: #FFFBEB;
    border-left: 3px solid #F59E0B;
    border-radius: 6px;
    font-size: 0.82rem;
    color: #78350F;
    line-height: 1.45;
}

.face-footer-prompt {
    text-align: center;
    font-size: 0.78rem;
    font-weight: 600;
    color: #94A3B8;
}

/* SM-2 Buttons Bar */
.stage-sm2-bar {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 16px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.sm2-bar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sm2-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #475569;
}

.sm2-keyboard-guide {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    color: #94A3B8;
}

.sm2-btn-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.sm2-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.85rem 0.5rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
}

.sm2-btn strong {
    font-size: 0.88rem;
}

.interval-hint {
    font-size: 0.72rem;
    opacity: 0.8;
}

/* Again (1) - Red */
.btn-sm2-again {
    background: #FEF2F2;
    border: 1.5px solid #FECACA;
    color: #DC2626;
}

.btn-sm2-again:hover {
    background: #FEE2E2;
    border-color: #F87171;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.15);
}

/* Hard (2) - Orange */
.btn-sm2-hard {
    background: #FFF7ED;
    border: 1.5px solid #FED7AA;
    color: #EA580C;
}

.btn-sm2-hard:hover {
    background: #FFEDD5;
    border-color: #FB923C;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(234, 88, 12, 0.15);
}

/* Good (3) - Emerald */
.btn-sm2-good {
    background: #ECFDF5;
    border: 1.5px solid #A7F3D0;
    color: #059669;
}

.btn-sm2-good:hover {
    background: #D1FAE5;
    border-color: #34D399;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.15);
}

/* Easy (4) - Blue */
.btn-sm2-easy {
    background: #EFF6FF;
    border: 1.5px solid #BFDBFE;
    color: #2563EB;
}

.btn-sm2-easy:hover {
    background: #DBEAFE;
    border-color: #60A5FA;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

/* Toast Message: Floating Bottom Center Overlay (Zero Layout Shift) */
#stage-sm2-toast,
.stage-toast {
    position: fixed !important;
    bottom: 2rem !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    top: auto !important;
    right: auto !important;
    z-index: 999999 !important;
    background: rgba(15, 23, 42, 0.95) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    color: #FFFFFF !important;
    padding: 0.75rem 1.45rem !important;
    border-radius: 9999px !important;
    font-size: 0.86rem !important;
    font-weight: 600 !important;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35) !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    animation: toastBottomSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    pointer-events: auto;
    text-align: center;
    max-width: 90vw;
}

@keyframes toastBottomSlideUp {
    from { opacity: 0; transform: translate(-50%, 16px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

@media (max-width: 640px) {
    .sm2-btn-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==============================================================================
   VIDYORIC NATURAL SPEECH NARRATOR & AUDIO DOCK (TASK: FREE HIGH-QUALITY SPEECH)
   ============================================================================== */

/* Toolbar Listen Button */
.btn-listen-notes {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: linear-gradient(135deg, #012B5A 0%, #1E40AF 100%);
    color: #FFFFFF;
    border: none;
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(1, 43, 90, 0.2);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-listen-notes:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.35);
    background: linear-gradient(135deg, #02366E 0%, #2563EB 100%);
}

.btn-listen-notes:active {
    transform: translateY(0);
}

.btn-listen-notes.listening {
    background: linear-gradient(135deg, #059669 0%, #10B981 100%);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
    animation: listenPulse 2s infinite;
}

@keyframes listenPulse {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.btn-listen-notes .listen-icon {
    font-size: 0.85rem;
    line-height: 1;
}

/* Audio Settings Toggle Button */
.btn-audio-settings {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: #FFFFFF;
    color: #012B5A;
    border: 1.5px solid #CBD5E1;
    padding: 0.32rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-audio-settings:hover {
    background: #F8FAFC;
    border-color: #012B5A;
    color: #1E40AF;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(1, 43, 90, 0.15);
}

.btn-audio-settings .settings-icon {
    font-size: 0.85rem;
    line-height: 1;
}

/* Readable Segments Hover & Focus */
.narrator-readable {
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    border-radius: 6px;
}

.narrator-readable:hover {
    background-color: rgba(241, 245, 249, 0.6);
}

/* Active Narration Karaoke Glowing Sentence / Block */
.narrator-active-sentence {
    background: rgba(37, 99, 235, 0.08) !important;
    border-left: 4px solid #2563EB !important;
    border-radius: 8px !important;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15), 0 4px 14px rgba(37, 99, 235, 0.08) !important;
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
    animation: narratorGlow 3s ease-in-out infinite alternate;
}

@keyframes narratorGlow {
    from {
        background-color: rgba(37, 99, 235, 0.07);
        border-left-color: #2563EB;
    }
    to {
        background-color: rgba(37, 99, 235, 0.12);
        border-left-color: #1D4ED8;
    }
}

/* Floating Glassmorphism Narration Player Dock */
.narrator-player-dock {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99999;
    width: calc(100% - 2rem);
    max-width: 860px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1.5px solid rgba(203, 213, 225, 0.95);
    border-radius: 16px;
    box-shadow: 0 20px 45px -10px rgba(15, 23, 42, 0.35), 0 4px 12px rgba(15, 23, 42, 0.08);
    padding: 0.65rem 1.15rem;
    animation: slideUpDock 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
}

@keyframes slideUpDock {
    from {
        opacity: 0;
        transform: translate(-50%, 24px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

.narrator-dock-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    flex-wrap: wrap;
}

.narrator-dock-left {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex: 1;
    min-width: 260px;
}

.dock-btn-play {
    background: #012B5A;
    color: #FFFFFF;
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(1, 43, 90, 0.3);
    transition: transform 0.15s ease, background 0.15s ease;
    flex-shrink: 0;
}

.dock-btn-play:hover {
    background: #1E40AF;
    transform: scale(1.05);
}

.dock-btn-stop,
.dock-btn-nav {
    background: #F1F5F9;
    border: 1px solid #E2E8F0;
    color: #334155;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.dock-btn-stop:hover,
.dock-btn-nav:hover {
    background: #E2E8F0;
    color: #0F172A;
    transform: translateY(-1px);
}

.narrator-dock-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
    min-width: 130px;
}

.dock-counter-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
}

.dock-reading-label {
    font-weight: 700;
    color: #012B5A;
}

.dock-counter {
    color: #64748B;
    font-weight: 600;
}

.dock-progress-track {
    width: 100%;
    height: 5px;
    background: #E2E8F0;
    border-radius: 9999px;
    overflow: hidden;
}

.dock-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2563EB 0%, #10B981 100%);
    border-radius: 9999px;
    transition: width 0.3s ease;
}

.narrator-dock-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.narrator-speed-group {
    display: flex;
    align-items: center;
    background: #F1F5F9;
    padding: 2px;
    border-radius: 8px;
    border: 1px solid #E2E8F0;
}

.narrator-speed-btn {
    background: transparent;
    border: none;
    font-size: 0.72rem;
    font-weight: 700;
    color: #64748B;
    padding: 0.25rem 0.55rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.narrator-speed-btn:hover {
    color: #0F172A;
}

.narrator-speed-btn.active {
    background: #FFFFFF;
    color: #012B5A;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.narrator-voice-wrap {
    position: relative;
    max-width: 220px;
}

.narrator-voice-select {
    background: #FFFFFF;
    border: 1px solid #CBD5E1;
    border-radius: 8px;
    font-size: 0.74rem;
    font-weight: 600;
    color: #334155;
    padding: 0.3rem 0.6rem;
    cursor: pointer;
    outline: none;
    max-width: 210px;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

.narrator-voice-select:focus {
    border-color: #2563EB;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.dock-btn-close {
    background: transparent;
    border: none;
    color: #94A3B8;
    font-size: 1rem;
    cursor: pointer;
    padding: 0.2rem 0.4rem;
    border-radius: 6px;
    transition: all 0.15s ease;
    line-height: 1;
}

.dock-btn-close:hover {
    background: #F1F5F9;
    color: #475569;
}

/* Completion Toast */
.narrator-toast {
    position: fixed;
    bottom: 5.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: #012B5A;
    color: #FFFFFF;
    padding: 0.65rem 1.25rem;
    border-radius: 9999px;
    font-size: 0.84rem;
    font-weight: 700;
    box-shadow: 0 10px 25px rgba(1, 43, 90, 0.35);
    z-index: 10000;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.narrator-toast.toast-fade {
    opacity: 0;
    transform: translate(-50%, 10px);
}

@media (max-width: 768px) {
    .narrator-player-dock {
        bottom: 1rem;
        padding: 0.6rem 0.75rem;
    }
    .narrator-dock-inner {
        gap: 0.6rem;
    }
    .narrator-voice-wrap {
        max-width: 140px;
    }
    .narrator-voice-select {
        max-width: 140px;
    }
}

/* ==============================================================================
   4. VIDYORIC STUDY WORKSPACE: MASTER MIDNIGHT DARK MODE
   Theme Key: [data-study-theme="dark"]
   Ergonomic, calm reading canvas with zero glare and calm matte highlighters.
   ============================================================================== */

/* Header Theme Toggle Button (Light Mode Default) */
.study-theme-toggle-btn {
    cursor: pointer;
    background: #F1F5F9;
    border: 1px solid #CBD5E1;
    color: #1E293B;
    font-size: 0.82rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    height: 34px;
    padding: 0 0.85rem;
    border-radius: 9999px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    box-sizing: border-box;
}

.study-theme-toggle-btn:hover {
    background: #E2E8F0;
    border-color: #94A3B8;
    color: #0F172A;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.study-theme-toggle-btn .theme-icon {
    font-size: 0.95rem;
    line-height: 1;
}

.study-theme-toggle-btn .theme-text {
    font-size: 0.8rem;
    font-weight: 700;
    color: #1E293B;
    letter-spacing: 0.02em;
}

/* Header Theme Toggle Button (Dark Mode Active) */
[data-study-theme="dark"] .study-theme-toggle-btn {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.16) !important;
    color: #F8FAFC !important;
}

[data-study-theme="dark"] .study-theme-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.16) !important;
    border-color: #BD9B61 !important;
    color: #FFFFFF !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25) !important;
}

[data-study-theme="dark"] .study-theme-toggle-btn .theme-text {
    color: #F8FAFC !important;
}

/* Base Viewport & Layout Shell in Dark Mode */
html[data-study-theme="dark"],
body.study-app-body[data-study-theme="dark"] {
    background-color: #071126 !important;
    color: #CBD5E1 !important;
}

[data-study-theme="dark"] .study-app-layout,
[data-study-theme="dark"] .study-content-viewport,
[data-study-theme="dark"] .study-stage-pane {
    background: #071126 !important;
}

[data-study-theme="dark"] .study-top-header {
    background: #020C1B !important;
    border-bottom: 1px solid #1E293B !important;
}

/* Header Search Bar in Dark Mode */
[data-study-theme="dark"] .header-search-wrap {
    background: #0B152B !important;
    border: 1px solid #1E293B !important;
}

[data-study-theme="dark"] .header-search-wrap:focus-within {
    background: #0E1B38 !important;
    border-color: #3B82F6 !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25) !important;
}

[data-study-theme="dark"] .header-search-input,
[data-study-theme="dark"] input[type="search"].header-search-input,
[data-study-theme="dark"] input[type="search"] {
    background: transparent !important;
    color: #F8FAFC !important;
    border: none !important;
    box-shadow: none !important;
}

[data-study-theme="dark"] .header-search-input::placeholder {
    color: #64748B !important;
}

[data-study-theme="dark"] .search-icon {
    color: #64748B !important;
}

[data-study-theme="dark"] .board-context-pill,
[data-study-theme="dark"] .streak-pill,
[data-study-theme="dark"] .sparks-pill {
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #E2E8F0 !important;
}

/* PANE 1: CURRICULUM TREE IN DARK MODE */
[data-study-theme="dark"] .curriculum-pane {
    background: #0B152B !important;
    border-right: 1px solid #1E293B !important;
    color: #CBD5E1 !important;
}

[data-study-theme="dark"] .curriculum-deck-title {
    color: #F8FAFC !important;
}

[data-study-theme="dark"] .back-decks-link {
    color: #94A3B8 !important;
}

[data-study-theme="dark"] .back-decks-link:hover {
    color: #BD9B61 !important;
}

[data-study-theme="dark"] .progress-labels {
    color: #CBD5E1 !important;
}

[data-study-theme="dark"] .progress-bar-track {
    background: #1E293B !important;
}

[data-study-theme="dark"] .progress-sub-text {
    color: #94A3B8 !important;
}

[data-study-theme="dark"] .tree-section-header {
    border-top: 1px solid #1E293B !important;
    color: #94A3B8 !important;
}

[data-study-theme="dark"] .folder-header.node-header:hover {
    background: rgba(255, 255, 255, 0.05) !important;
}

[data-study-theme="dark"] .tree-roadmap-node.node-open > .folder-header.node-header {
    background: rgba(37, 99, 235, 0.15) !important;
}

[data-study-theme="dark"] .node-circle-marker {
    background: #071126 !important;
    border-color: #334155 !important;
    color: #94A3B8 !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3) !important;
}

[data-study-theme="dark"] .node-circle-marker.active,
[data-study-theme="dark"] .tree-roadmap-node.node-open .node-circle-marker {
    background: #2563EB !important;
    border-color: #3B82F6 !important;
    color: #FFFFFF !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.28) !important;
}

[data-study-theme="dark"] .node-stage-tag {
    color: #60A5FA !important;
}

[data-study-theme="dark"] .node-title {
    color: #F8FAFC !important;
}

[data-study-theme="dark"] .node-topic-subtitle,
[data-study-theme="dark"] .folder-desc,
[data-study-theme="dark"] .curriculum-step-desc,
[data-study-theme="dark"] .step-nav-meta {
    color: #94A3B8 !important;
}

[data-study-theme="dark"] .tree-roadmap-node:not(:last-child):not(.node-open)::after {
    background: #1D4ED8 !important;
}

[data-study-theme="dark"] .node-toggle-btn {
    background: #0E1B38 !important;
    border-color: #1E293B !important;
    color: #94A3B8 !important;
}

[data-study-theme="dark"] .tree-steps-container {
    border-left: 2px solid #1E293B !important;
}

[data-study-theme="dark"] .step-nav-item {
    color: #CBD5E1 !important;
}

[data-study-theme="dark"] .step-nav-item:hover {
    background: rgba(255, 255, 255, 0.04) !important;
}

[data-study-theme="dark"] .step-nav-item.active {
    background: #0E1B38 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35) !important;
}

[data-study-theme="dark"] .step-nav-title {
    color: #E2E8F0 !important;
}

[data-study-theme="dark"] .step-nav-item.active .step-nav-title {
    color: #60A5FA !important;
}

[data-study-theme="dark"] .step-number-idle {
    background: #1E293B !important;
    color: #94A3B8 !important;
}

[data-study-theme="dark"] .deck-resources-box {
    border-top: 1px solid #1E293B !important;
}

[data-study-theme="dark"] .res-count-badge {
    background: rgba(37, 99, 235, 0.2) !important;
    color: #93C5FD !important;
    border: 1px solid rgba(37, 99, 235, 0.4) !important;
}

[data-study-theme="dark"] .resource-link {
    background: #0B152B !important;
    border: 1px solid #1E293B !important;
    color: #CBD5E1 !important;
}

[data-study-theme="dark"] .resource-link:hover {
    background: #0E1B38 !important;
    border-color: #334155 !important;
    color: #F8FAFC !important;
}

[data-study-theme="dark"] .resource-link .res-title {
    color: #E2E8F0 !important;
}

[data-study-theme="dark"] .resource-link .res-size {
    color: #94A3B8 !important;
}

[data-study-theme="dark"] .resource-link .res-action-arrow {
    color: #94A3B8 !important;
}

[data-study-theme="dark"] .resource-link:hover .res-action-arrow {
    color: #60A5FA !important;
}

[data-study-theme="dark"] .resource-link-locked {
    background: rgba(245, 158, 11, 0.08) !important;
    border-color: rgba(245, 158, 11, 0.25) !important;
    color: #FDE68A !important;
}

[data-study-theme="dark"] .resource-link-locked:hover {
    background: rgba(245, 158, 11, 0.16) !important;
    border-color: rgba(245, 158, 11, 0.45) !important;
}

[data-study-theme="dark"] .resources-empty-state {
    background: #0B152B !important;
    border-color: #1E293B !important;
    color: #94A3B8 !important;
}

[data-study-theme="dark"] .resource-step-item .step-check-done {
    background: #1E293B !important;
    color: #94A3B8 !important;
}

/* PANE 2: CENTER STAGE CONTROLS */
[data-study-theme="dark"] .stage-control-bar-minimal {
    background: #0B152B !important;
    border: 1px solid #1E293B !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3) !important;
}

[data-study-theme="dark"] .bc-deck {
    background: rgba(37, 99, 235, 0.15) !important;
    border-color: rgba(37, 99, 235, 0.35) !important;
    color: #93C5FD !important;
}

[data-study-theme="dark"] .stage-main-title {
    color: #F8FAFC !important;
}

[data-study-theme="dark"] .stage-pill {
    background: #0E1B38 !important;
    border-color: #1E293B !important;
    color: #94A3B8 !important;
}

[data-study-theme="dark"] .stage-pill-xp {
    background: rgba(180, 83, 9, 0.15) !important;
    border-color: rgba(245, 158, 11, 0.3) !important;
    color: #FDE68A !important;
}

[data-study-theme="dark"] .stage-nav-btn {
    background: #0E1B38 !important;
    border-color: #1E293B !important;
    color: #CBD5E1 !important;
}

[data-study-theme="dark"] .stage-nav-btn:hover {
    background: #1E293B !important;
    color: #F8FAFC !important;
}

/* STEP 1: VIDEO STAGE */
[data-study-theme="dark"] .stage-video-box {
    background: #0B152B !important;
    border-color: #1E293B !important;
}

[data-study-theme="dark"] .video-chapter-pill {
    background: #0E1B38 !important;
    border-color: #1E293B !important;
    color: #CBD5E1 !important;
}

[data-study-theme="dark"] .transcript-line {
    color: #94A3B8 !important;
}

[data-study-theme="dark"] .transcript-line.active {
    background: rgba(37, 99, 235, 0.18) !important;
    color: #F8FAFC !important;
}

/* STEP 2: STAGE CARD BODY & NOTES TOOLBAR IN DARK MODE */
[data-study-theme="dark"] .stage-card-body,
[data-study-theme="dark"] .notes-card-body {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    box-shadow: none !important;
}

[data-study-theme="dark"] .notes-stage-toolbar {
    background: #0B152B !important;
    border: 1px solid #1E293B !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25) !important;
    margin-bottom: 0.85rem !important;
}

[data-study-theme="dark"] .notes-tag {
    background: rgba(37, 99, 235, 0.15) !important;
    color: #60A5FA !important;
}

[data-study-theme="dark"] .notes-read-time {
    background: #071126 !important;
    border: 1px solid #1E293B !important;
    color: #94A3B8 !important;
}

[data-study-theme="dark"] .audio-control-group {
    background: #071126 !important;
    border-color: #1E293B !important;
}

[data-study-theme="dark"] .btn-listen-notes {
    color: #E2E8F0 !important;
    border-right: 1px solid #1E293B !important;
    background: transparent !important;
}

[data-study-theme="dark"] .btn-listen-notes:hover {
    background: #0E1B38 !important;
    color: #FFFFFF !important;
}

[data-study-theme="dark"] .btn-audio-settings {
    color: #94A3B8 !important;
    background: transparent !important;
}

[data-study-theme="dark"] .btn-audio-settings:hover {
    background: #0E1B38 !important;
    color: #FFFFFF !important;
}

[data-study-theme="dark"] .btn-add-visual-note {
    background: #071126 !important;
    border: 1px solid #1E293B !important;
    color: #CBD5E1 !important;
}

[data-study-theme="dark"] .btn-add-visual-note:hover {
    background: #1E293B !important;
    color: #F8FAFC !important;
}

[data-study-theme="dark"] .highlights-count-pill {
    background: #071126 !important;
    border: 1px solid #1E293B !important;
    color: #E2E8F0 !important;
}

/* STEP 2: NOTES READING CANVAS */
[data-study-theme="dark"] .notes-reading-canvas {
    background: #0B152B !important;
    border: 1px solid #1E293B !important;
    color: #CBD5E1 !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4) !important;
}


[data-study-theme="dark"] .notes-h2 {
    color: #F8FAFC !important;
    border-bottom: 2px solid #1E293B !important;
}

[data-study-theme="dark"] .notes-h3,
[data-study-theme="dark"] .notes-h4 {
    color: #F8FAFC !important;
}

[data-study-theme="dark"] .notes-h5 {
    color: #E2E8F0 !important;
}

[data-study-theme="dark"] .notes-p,
[data-study-theme="dark"] .notes-ul,
[data-study-theme="dark"] .notes-ol {
    color: #CBD5E1 !important;
}

[data-study-theme="dark"] .notes-divider {
    background: #1E293B !important;
}

[data-study-theme="dark"] .notes-blockquote {
    background: #0E1B38 !important;
    border-left-color: #3B82F6 !important;
    color: #94A3B8 !important;
}

[data-study-theme="dark"] .notes-inline-code {
    background: #0E1B38 !important;
    border-color: #1E293B !important;
    color: #93C5FD !important;
}

[data-study-theme="dark"] .notes-code-box {
    background: #030A16 !important;
    border: 1px solid #1E293B !important;
}

[data-study-theme="dark"] .notes-code-lang {
    background: #0E1B38 !important;
    color: #94A3B8 !important;
}

[data-study-theme="dark"] .notes-table-wrap {
    background: #0B152B !important;
    border-color: #1E293B !important;
}

[data-study-theme="dark"] .notes-table th {
    background: #0E1B38 !important;
    color: #F8FAFC !important;
    border-bottom: 1.5px solid #1E293B !important;
}

[data-study-theme="dark"] .notes-table td {
    border-bottom: 1px solid #1E293B !important;
    color: #CBD5E1 !important;
}

/* KaTeX Mathematical Notation in Dark Mode (Crisp Soft White Foreground) */
[data-study-theme="dark"] .katex {
    color: #F1F5F9 !important;
}

[data-study-theme="dark"] .notes-math-display {
    background: #0E1B38 !important;
    border: 1px solid #1E293B !important;
    border-left: 4px solid #2563EB !important;
    color: #F1F5F9 !important;
}

[data-study-theme="dark"] .notes-formula-box {
    background: #0B152B !important;
    border-color: #1E293B !important;
}

[data-study-theme="dark"] .notes-sub-title {
    color: #F8FAFC !important;
}

[data-study-theme="dark"] .katex-item-card {
    background: #0E1B38 !important;
    border-color: #1E293B !important;
    color: #F1F5F9 !important;
}

[data-study-theme="dark"] .formula-katex-text {
    color: #F1F5F9 !important;
}

/* VISUAL CONCEPT DIAGRAMS & FIGURES IN DARK MODE */
[data-study-theme="dark"] .notes-diagrams-box {
    background: #0B152B !important;
    border: 1px solid #1E293B !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25) !important;
}

[data-study-theme="dark"] .notes-diagram-card {
    background: #0E1B38 !important;
    border: 1px solid #1E293B !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
}

[data-study-theme="dark"] .notes-diagram-card:hover {
    border-color: #334155 !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45) !important;
}

[data-study-theme="dark"] .diagram-title {
    color: #F8FAFC !important;
}

[data-study-theme="dark"] .diagram-badge {
    background: rgba(37, 99, 235, 0.18) !important;
    border: 1px solid rgba(37, 99, 235, 0.4) !important;
    color: #93C5FD !important;
}

[data-study-theme="dark"] .box-badge {
    background: rgba(37, 99, 235, 0.18) !important;
    border: 1px solid rgba(37, 99, 235, 0.35) !important;
    color: #93C5FD !important;
}

[data-study-theme="dark"] .diagram-visual-viewport {
    background: #071126 !important;
    border: 1px solid #1E293B !important;
}

[data-study-theme="dark"] .diagram-caption {
    background: #071126 !important;
    border-left: 3px solid #3B82F6 !important;
    color: #CBD5E1 !important;
}

[data-study-theme="dark"] .diagram-zoom-pill {
    background: rgba(15, 23, 42, 0.9) !important;
    color: #F8FAFC !important;
    border: 1px solid #334155 !important;
}

/* CALM MATTE PEDAGOGICAL HIGHLIGHTERS (ZERO GLOW, EYE-STRAIN FREE FOR LONG NIGHT SESSIONS) */
[data-study-theme="dark"] .vidyoric-highlight.hl-yellow,
[data-study-theme="dark"] mark.hl-yellow {
    background-color: rgba(245, 158, 11, 0.16) !important;
    color: #FDE68A !important;
    border-bottom: 2px solid rgba(245, 158, 11, 0.45) !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

[data-study-theme="dark"] .vidyoric-highlight.hl-green,
[data-study-theme="dark"] mark.hl-green {
    background-color: rgba(16, 185, 129, 0.16) !important;
    color: #A7F3D0 !important;
    border-bottom: 2px solid rgba(16, 185, 129, 0.45) !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

[data-study-theme="dark"] .vidyoric-highlight.hl-pink,
[data-study-theme="dark"] mark.hl-pink {
    background-color: rgba(244, 114, 182, 0.16) !important;
    color: #FBCFE8 !important;
    border-bottom: 2px solid rgba(244, 114, 182, 0.45) !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

[data-study-theme="dark"] .vidyoric-highlight.hl-blue,
[data-study-theme="dark"] mark.hl-blue {
    background-color: rgba(59, 130, 246, 0.16) !important;
    color: #BFDBFE !important;
    border-bottom: 2px solid rgba(59, 130, 246, 0.45) !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

[data-study-theme="dark"] .vidyoric-highlight.hl-purple,
[data-study-theme="dark"] mark.hl-purple {
    background-color: rgba(139, 92, 246, 0.16) !important;
    color: #DDD6FE !important;
    border-bottom: 2px solid rgba(139, 92, 246, 0.45) !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

/* Callouts, Traps & Keypoints in Dark Mode */
[data-study-theme="dark"] .kp-item {
    background: #0E1B38 !important;
    border-color: #1E293B !important;
}

[data-study-theme="dark"] .kp-text {
    color: #CBD5E1 !important;
}

[data-study-theme="dark"] .exam-trap-banner {
    background: rgba(180, 83, 9, 0.12) !important;
    border-color: rgba(245, 158, 11, 0.35) !important;
}

[data-study-theme="dark"] .trap-title {
    color: #FDE68A !important;
}

[data-study-theme="dark"] .trap-desc {
    color: #FCD34D !important;
}

[data-study-theme="dark"] .notes-callout-warning {
    background: rgba(180, 83, 9, 0.12) !important;
    border-color: rgba(245, 158, 11, 0.35) !important;
    color: #FDE68A !important;
}

[data-study-theme="dark"] .notes-callout-tip {
    background: rgba(5, 150, 105, 0.12) !important;
    border-color: rgba(16, 185, 129, 0.35) !important;
    color: #A7F3D0 !important;
}

[data-study-theme="dark"] .notes-callout-formula {
    background: rgba(107, 33, 168, 0.12) !important;
    border-color: rgba(139, 92, 246, 0.35) !important;
    color: #DDD6FE !important;
}

/* Diagram Cards & Lightbox in Dark Mode */
[data-study-theme="dark"] .notes-diagram-card {
    background: #0E1B38 !important;
    border-color: #1E293B !important;
}

[data-study-theme="dark"] .diagram-title {
    color: #F8FAFC !important;
}

[data-study-theme="dark"] .diagram-caption {
    color: #94A3B8 !important;
}

[data-study-theme="dark"] .diagram-viewport {
    background: #071126 !important;
}

[data-study-theme="dark"] .lightbox-modal-card {
    background: #0B152B !important;
    border-color: #1E293B !important;
}

/* Student Saved Notes Drawer & Margin Modal in Dark Mode */
[data-study-theme="dark"] .student-notes-panel {
    background: #0B152B !important;
    border-color: #1E293B !important;
}

[data-study-theme="dark"] .notes-panel-header {
    background: #0E1B38 !important;
    border-bottom-color: #1E293B !important;
}

[data-study-theme="dark"] .panel-title {
    color: #F8FAFC !important;
}

[data-study-theme="dark"] .btn-toggle-notes-tray {
    background: #071126 !important;
    border-color: #1E293B !important;
    color: #CBD5E1 !important;
}

[data-study-theme="dark"] .notes-panel-body {
    background: #0B152B !important;
}

[data-study-theme="dark"] .student-note-card {
    background: #0E1B38 !important;
    border-color: #1E293B !important;
}

[data-study-theme="dark"] .note-card-quote {
    background: #071126 !important;
    color: #CBD5E1 !important;
    border-left-color: #334155 !important;
}

[data-study-theme="dark"] .note-card-user-note {
    background: rgba(37, 99, 235, 0.12) !important;
    border-color: rgba(37, 99, 235, 0.3) !important;
    color: #BFDBFE !important;
}

[data-study-theme="dark"] .btn-card-action {
    background: #071126 !important;
    border-color: #1E293B !important;
    color: #94A3B8 !important;
}

[data-study-theme="dark"] .btn-card-action:hover {
    background: #1E293B !important;
    color: #F8FAFC !important;
}

[data-study-theme="dark"] .modal-card {
    background: #0B152B !important;
    border: 1px solid #1E293B !important;
    color: #F8FAFC !important;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.6) !important;
}

[data-study-theme="dark"] .modal-title {
    color: #F8FAFC !important;
}

[data-study-theme="dark"] .modal-text-preview {
    background: #071126 !important;
    border-left-color: #2563EB !important;
    color: #CBD5E1 !important;
}

[data-study-theme="dark"] .modal-note-textarea {
    background: #071126 !important;
    border-color: #1E293B !important;
    color: #F8FAFC !important;
}

[data-study-theme="dark"] .modal-close {
    color: #94A3B8 !important;
}

[data-study-theme="dark"] .dict-modal-card {
    background: #0B152B !important;
    border: 1px solid #1E293B !important;
    color: #F8FAFC !important;
}

[data-study-theme="dark"] .dict-meaning-box {
    background: #0E1B38 !important;
    border-color: #1E293B !important;
}

[data-study-theme="dark"] .dict-def-text {
    color: #CBD5E1 !important;
}

/* Audio Narrator Dock in Dark Mode */
[data-study-theme="dark"] .narrator-player-dock {
    background: rgba(11, 21, 43, 0.92) !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6) !important;
}

[data-study-theme="dark"] .narrator-dock-label,
[data-study-theme="dark"] .narrator-voice-label,
[data-study-theme="dark"] .narrator-progress-text {
    color: #E2E8F0 !important;
}

[data-study-theme="dark"] .narrator-voice-select {
    background: #071126 !important;
    border-color: #1E293B !important;
    color: #F8FAFC !important;
}

[data-study-theme="dark"] .narrator-btn-dock-action {
    background: #0E1B38 !important;
    border-color: #1E293B !important;
    color: #E2E8F0 !important;
}

[data-study-theme="dark"] .narrator-active-sentence {
    background: rgba(37, 99, 235, 0.22) !important;
    border-bottom: 2px solid #3B82F6 !important;
    animation: none !important;
}

/* STEP 3: 3D FLASHCARDS & SM-2 BAR IN DARK MODE */
[data-study-theme="dark"] .stage-face {
    background: #0B152B !important;
    border: 2px solid #1E293B !important;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45) !important;
}

[data-study-theme="dark"] .stage-face.face-back {
    border-color: #059669 !important;
}

[data-study-theme="dark"] .face-prompt,
[data-study-theme="dark"] .face-answer {
    color: #F8FAFC !important;
}

[data-study-theme="dark"] .face-hint-callout {
    background: rgba(37, 99, 235, 0.15) !important;
    border: 1px solid rgba(37, 99, 235, 0.3) !important;
    color: #93C5FD !important;
}

[data-study-theme="dark"] .face-hint-prompt {
    color: #64748B !important;
}

[data-study-theme="dark"] .fc-due-badge {
    background: rgba(99, 102, 241, 0.15) !important;
    border: 1px solid rgba(99, 102, 241, 0.35) !important;
    color: #A5B4FC !important;
}

[data-study-theme="dark"] .fc-card-count {
    color: #94A3B8 !important;
}

[data-study-theme="dark"] .btn-fc-nav {
    background: #0B152B !important;
    border: 1.5px solid #1E293B !important;
    color: #CBD5E1 !important;
}

[data-study-theme="dark"] .btn-fc-nav:hover:not(:disabled) {
    background: #0E1B38 !important;
    border-color: #3B82F6 !important;
    color: #93C5FD !important;
}

[data-study-theme="dark"] .btn-fc-nav:disabled {
    opacity: 0.35 !important;
    background: #071126 !important;
    border-color: #1E293B !important;
    color: #64748B !important;
}

[data-study-theme="dark"] .btn-star-card {
    background: #0E1B38 !important;
    border-color: #1E293B !important;
    color: #E2E8F0 !important;
}

[data-study-theme="dark"] .btn-star-card:hover {
    border-color: #F59E0B !important;
    background: rgba(245, 158, 11, 0.12) !important;
    color: #FDE68A !important;
}

[data-study-theme="dark"] .btn-star-card.bookmarked {
    background: rgba(245, 158, 11, 0.15) !important;
    border-color: #F59E0B !important;
    color: #FDE68A !important;
}

[data-study-theme="dark"] .face-keyboard-hint {
    background: #1E293B !important;
    border: 1px solid #334155 !important;
    color: #94A3B8 !important;
}

[data-study-theme="dark"] .btn-hint-toggle {
    background: rgba(245, 158, 11, 0.15) !important;
    border: 1px solid rgba(245, 158, 11, 0.35) !important;
    color: #FDE68A !important;
}

[data-study-theme="dark"] .btn-hint-toggle:hover {
    background: rgba(245, 158, 11, 0.25) !important;
    border-color: rgba(245, 158, 11, 0.5) !important;
}

[data-study-theme="dark"] .face-hint-text {
    background: rgba(245, 158, 11, 0.1) !important;
    border-left: 3px solid #F59E0B !important;
    color: #FDE68A !important;
}

[data-study-theme="dark"] .face-footer-prompt {
    color: #94A3B8 !important;
}

[data-study-theme="dark"] .stage-sm2-bar {
    background: #0B152B !important;
    border: 1.5px solid #1E293B !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35) !important;
}

[data-study-theme="dark"] .sm2-title {
    color: #E2E8F0 !important;
}

[data-study-theme="dark"] .sm2-keyboard-guide {
    color: #64748B !important;
}

/* SM-2 Algorithm Rating Buttons in Dark Mode: Ergonomic tinted dark surfaces with soft borders */
[data-study-theme="dark"] .btn-sm2-again {
    background: rgba(239, 68, 68, 0.12) !important;
    border: 1.5px solid rgba(239, 68, 68, 0.35) !important;
    color: #FCA5A5 !important;
}

[data-study-theme="dark"] .btn-sm2-again:hover {
    background: rgba(239, 68, 68, 0.22) !important;
    border-color: rgba(239, 68, 68, 0.6) !important;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.25) !important;
}

[data-study-theme="dark"] .btn-sm2-hard {
    background: rgba(249, 115, 22, 0.12) !important;
    border: 1.5px solid rgba(249, 115, 22, 0.35) !important;
    color: #FDBA74 !important;
}

[data-study-theme="dark"] .btn-sm2-hard:hover {
    background: rgba(249, 115, 22, 0.22) !important;
    border-color: rgba(249, 115, 22, 0.6) !important;
    box-shadow: 0 4px 14px rgba(249, 115, 22, 0.25) !important;
}

[data-study-theme="dark"] .btn-sm2-good {
    background: rgba(16, 185, 129, 0.12) !important;
    border: 1.5px solid rgba(16, 185, 129, 0.35) !important;
    color: #6EE7B7 !important;
}

[data-study-theme="dark"] .btn-sm2-good:hover {
    background: rgba(16, 185, 129, 0.22) !important;
    border-color: rgba(16, 185, 129, 0.6) !important;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25) !important;
}

[data-study-theme="dark"] .btn-sm2-easy {
    background: rgba(59, 130, 246, 0.12) !important;
    border: 1.5px solid rgba(59, 130, 246, 0.35) !important;
    color: #93C5FD !important;
}

[data-study-theme="dark"] .btn-sm2-easy:hover {
    background: rgba(59, 130, 246, 0.22) !important;
    border-color: rgba(59, 130, 246, 0.6) !important;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.25) !important;
}

[data-study-theme="dark"] .stage-sm2-bar .interval-hint {
    color: #94A3B8 !important;
}

/* Bottom Flashcard Navigation Bar in Dark Mode */
[data-study-theme="dark"] .fc-bottom-nav {
    background: #0B152B !important;
    border: 1.5px solid #1E293B !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
}

[data-study-theme="dark"] .fc-nav-arrow-btn {
    background: #071126 !important;
    border: 1.5px solid #1E293B !important;
    color: #CBD5E1 !important;
}

[data-study-theme="dark"] .fc-nav-arrow-btn:hover:not(:disabled) {
    background: #0E1B38 !important;
    border-color: #3B82F6 !important;
    color: #93C5FD !important;
}

[data-study-theme="dark"] .fc-nav-arrow-btn:disabled {
    opacity: 0.35 !important;
    background: #071126 !important;
    border-color: #1E293B !important;
    color: #475569 !important;
}

[data-study-theme="dark"] .fc-nav-arrow-btn.fc-nav-arrow-next {
    background: #1D4ED8 !important;
    border-color: #2563EB !important;
    color: #FFFFFF !important;
}

[data-study-theme="dark"] .fc-nav-arrow-btn.fc-nav-arrow-next:hover:not(:disabled) {
    background: #2563EB !important;
    border-color: #3B82F6 !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4) !important;
}

[data-study-theme="dark"] .fc-pill {
    background: #071126 !important;
    border: 1.5px solid #1E293B !important;
    color: #94A3B8 !important;
}

[data-study-theme="dark"] .fc-pill:hover {
    border-color: #3B82F6 !important;
    color: #93C5FD !important;
    background: #0E1B38 !important;
}

[data-study-theme="dark"] .fc-pill.active {
    background: #2563EB !important;
    border-color: #3B82F6 !important;
    color: #FFFFFF !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.35) !important;
}

[data-study-theme="dark"] .fc-pill.rated:not(.active) {
    border-color: #059669 !important;
    background: rgba(16, 185, 129, 0.15) !important;
    color: #34D399 !important;
}

/* Flashcard Session Completion Card in Dark Mode */
[data-study-theme="dark"] .fc-completed-card {
    background: linear-gradient(135deg, #0B152B 0%, #064E3B 100%) !important;
    border: 1.5px solid #065F46 !important;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.5) !important;
}

[data-study-theme="dark"] .fc-complete-badge {
    background: rgba(16, 185, 129, 0.2) !important;
    color: #6EE7B7 !important;
}

[data-study-theme="dark"] .fc-complete-title {
    color: #F8FAFC !important;
}

[data-study-theme="dark"] .fc-complete-sub {
    color: #94A3B8 !important;
}

[data-study-theme="dark"] .fc-stat-box {
    background: #071126 !important;
    border: 1.5px solid #1E293B !important;
}

[data-study-theme="dark"] .fc-stat-num {
    color: #10B981 !important;
}

[data-study-theme="dark"] .fc-stat-lbl {
    color: #94A3B8 !important;
}

[data-study-theme="dark"] .btn-fc-restart {
    background: #0B152B !important;
    border: 1.5px solid #1E293B !important;
    color: #CBD5E1 !important;
}

[data-study-theme="dark"] .btn-fc-restart:hover {
    background: #0E1B38 !important;
    border-color: #3B82F6 !important;
    color: #93C5FD !important;
}

[data-study-theme="dark"] #fcPreviewLockCard {
    background: #0B152B !important;
    border-color: #1E293B !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4) !important;
}

[data-study-theme="dark"] #fcPreviewLockCard h3 {
    color: #F8FAFC !important;
}

[data-study-theme="dark"] #fcPreviewLockCard p {
    color: #94A3B8 !important;
}

/* STEP 4: DIAGNOSTIC QUIZ IN DARK MODE */
[data-study-theme="dark"] .qr-prompt-card {
    background: #0B152B !important;
    border: 1.5px solid #1E293B !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35) !important;
}

[data-study-theme="dark"] .qr-question-prompt {
    color: #F8FAFC !important;
}

[data-study-theme="dark"] .qr-step-count {
    color: #94A3B8 !important;
}

[data-study-theme="dark"] .qr-step-count strong {
    color: #F8FAFC !important;
}

[data-study-theme="dark"] .qr-option-card {
    background: #0E1B38 !important;
    border: 1.5px solid #1E293B !important;
    color: #CBD5E1 !important;
}

[data-study-theme="dark"] .qr-option-card:hover:not(:disabled) {
    background: rgba(37, 99, 235, 0.12) !important;
    border-color: #3B82F6 !important;
    color: #F8FAFC !important;
}

[data-study-theme="dark"] .qr-option-card.selected {
    background: rgba(37, 99, 235, 0.22) !important;
    border-color: #2563EB !important;
    color: #FFFFFF !important;
}

[data-study-theme="dark"] .qr-opt-letter {
    background: #071126 !important;
    border: 1px solid #1E293B !important;
    color: #94A3B8 !important;
}

[data-study-theme="dark"] .qr-fib-container {
    background: #0B152B !important;
    border: 1.5px solid #1E293B !important;
}

[data-study-theme="dark"] .qr-fib-input {
    background: #071126 !important;
    border: 1.5px solid #1E293B !important;
    color: #F8FAFC !important;
}

[data-study-theme="dark"] .qr-hint-text {
    background: #1E293B !important;
    color: #CBD5E1 !important;
}

[data-study-theme="dark"] .qr-swipe-card {
    background: #0B152B !important;
    border: 2px solid #1E293B !important;
    color: #F8FAFC !important;
}

[data-study-theme="dark"] .qr-scorecard-wrap {
    background: #0B152B !important;
    border: 1.5px solid #1E293B !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45) !important;
}

[data-study-theme="dark"] .qr-score-title {
    color: #F8FAFC !important;
}

[data-study-theme="dark"] .qr-score-sub {
    color: #94A3B8 !important;
}

[data-study-theme="dark"] .qr-gauge-inner {
    background: #0B152B !important;
}

[data-study-theme="dark"] .qr-gauge-pct {
    color: #F8FAFC !important;
}

[data-study-theme="dark"] .qr-preview-mode-note {
    background: rgba(245, 158, 11, 0.1) !important;
    border-color: rgba(245, 158, 11, 0.3) !important;
    color: #FDE68A !important;
}

/* PAYWALL & LOCKED STEP CARD IN DARK MODE */
[data-study-theme="dark"] .locked-step-card {
    background: #0B152B !important;
    border-color: #1E293B !important;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45) !important;
}

[data-study-theme="dark"] .locked-step-card h2 {
    color: #F8FAFC !important;
}

[data-study-theme="dark"] .locked-step-card p {
    color: #94A3B8 !important;
}

/* PANE 3: ASK DECKZY AI COPILOT DRAWER IN DARK MODE */
[data-study-theme="dark"] .ask-deckzy-drawer {
    background: #0B152B !important;
    border-left: 1px solid #1E293B !important;
}

[data-study-theme="dark"] .deckzy-drawer-header {
    background: #0B152B !important;
    border-bottom: 1px solid #1E293B !important;
}

[data-study-theme="dark"] .deckzy-title {
    color: #F8FAFC !important;
}

[data-study-theme="dark"] .deckzy-messages-container {
    background: #071126 !important;
}

[data-study-theme="dark"] .deckzy-bubble-assistant {
    background: #0E1B38 !important;
    border: 1px solid #1E293B !important;
    color: #E2E8F0 !important;
}

[data-study-theme="dark"] .deckzy-bubble-user {
    background: #1D4ED8 !important;
    color: #FFFFFF !important;
}

[data-study-theme="dark"] .deckzy-input-bar {
    background: #0B152B !important;
    border-top: 1px solid #1E293B !important;
}

[data-study-theme="dark"] .deckzy-input-field {
    background: #071126 !important;
    border: 1px solid #1E293B !important;
    color: #F8FAFC !important;
}

[data-study-theme="dark"] .deckzy-chip-btn {
    background: #0E1B38 !important;
    border: 1px solid #1E293B !important;
    color: #93C5FD !important;
}

[data-study-theme="dark"] .deckzy-chip-btn:hover {
    background: #1E293B !important;
    color: #FFFFFF !important;
}
