@import url('https://fonts.googleapis.com/css2?family=Architects+Daughter&family=Bungee&family=Caveat:wght@600;700&family=Comic+Neue:wght@700&family=Dancing+Script:wght@700&family=Fira+Code:wght@500;700&family=Fredoka:wght@600;700&family=Gloria+Hallelujah&family=Indie+Flower&family=Inter:wght@500;700&family=JetBrains+Mono:wght@500;700&family=Kalam:wght@700&family=Lora:ital,wght@0,500;0,700;1,500&family=Merriweather:wght@400;700&family=Montserrat:wght@500;700;800&family=Outfit:wght@500;700;800&family=Permanent+Marker&family=Playfair+Display:ital,wght@0,700;1,700&family=Plus+Jakarta+Sans:wght@600;700&family=Poppins:wght@500;600;700&family=Righteous&family=Shadows+Into+Light&family=Space+Grotesk:wght@600;700&family=Space+Mono:wght@700&display=swap');

/* Student Library Scoped Styles */

:root {
    --lib-primary: #0A34D3;
    --lib-primary-light: rgba(10, 52, 211, 0.08);
    --lib-dark: #1A1B24;
    --lib-border: #1A1B24;
    --lib-bg: #F8FBFF;
    --lib-shadow: none;
    --lib-shadow-hover: none;
    --lib-transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Page Root Wrapper */
.library-root {
    min-height: 100vh;
    background-color: var(--lib-bg);
    padding: 120px 24px 60px 24px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.library-container {
    width: 100%;
    max-width: 1300px;
    margin: 0 auto;
}

/* Header & Intro Section */
.library-header {
    text-align: center;
    margin-bottom: 40px;
    max-width: 700px;
}

.library-header h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--lib-dark);
    margin-bottom: 12px;
    line-height: 1.2;
}

.library-header p {
    font-size: 1.1rem;
    color: #555555;
    line-height: 1.6;
}

/* Board and Grade Selectors Grid */
.selector-section {
    background: var(--lib-card-bg);
    border: 3px solid var(--lib-border);
    border-radius: 24px;
    padding: 32px;
    box-shadow: var(--lib-shadow);
    margin-bottom: 40px;
    box-sizing: border-box;
}

.selector-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 20px;
    color: var(--lib-dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

.selector-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 16px;
    background: var(--lib-primary);
    border-radius: 4px;
}

/* Board Toggle Row */
.board-toggle-row {
    display: flex;
    gap: 16px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.board-btn {
    padding: 12px 28px;
    border: 3px solid var(--lib-border);
    border-radius: 16px;
    background: var(--lib-card-bg);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--lib-transition);
    box-shadow: 0 4px 0 var(--lib-border);
}

.board-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 var(--lib-border);
}

.board-btn.active {
    background: var(--lib-primary);
    color: #FFFFFF;
    box-shadow: 0 4px 0 var(--lib-dark);
}

.board-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 var(--lib-border);
}

/* Grade Grid Selector */
.grade-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 12px;
}

.grade-btn {
    height: 70px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 3px solid var(--lib-border);
    border-radius: 16px;
    background: var(--lib-card-bg);
    font-weight: 800;
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--lib-transition);
    box-shadow: 0 3px 0 var(--lib-border);
}

.grade-btn span {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-top: 2px;
    color: #666;
}

.grade-btn.active span {
    color: #FFFFFF;
}

.grade-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 0 var(--lib-border);
}

.grade-btn.active {
    background: var(--lib-primary);
    color: #FFFFFF;
    box-shadow: 0 3px 0 var(--lib-dark);
}

.grade-btn:active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 var(--lib-border);
}

/* Subjects Grid Section */
.subjects-section-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 24px;
    color: var(--lib-dark);
}

.subjects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.subject-tips-card {
    background: #FFFBEB;
    border: 2px dashed #F59E0B;
    border-radius: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

@media (max-width: 768px) {
    .overlay-actions-tooltip {
        padding: 8px !important;
        border-radius: 12px !important;
        max-width: calc(100vw - 48px) !important;
        width: 290px !important;
        box-shadow: 0 4px 0 #272727 !important;
    }
    
    .overlay-tooltip-header {
        padding-bottom: 4px !important;
        margin-bottom: 2px !important;
    }
    
    .overlay-tooltip-buttons {
        gap: 4px !important;
    }
    
    .overlay-tooltip-buttons .tooltip-action-btn {
        padding: 4px 8px !important;
        font-size: 0.72rem !important;
        border-width: 1.5px !important;
        box-shadow: 0 1.5px 0 #272727 !important;
    }
    
    .workspace-pane {
        padding: 16px !important;
        border-radius: 20px !important;
    }
    
    .pdf-page-container {
        border-radius: 12px !important;
        border-width: 2px !important;
        box-shadow: none !important;
        margin-bottom: 20px !important;
    }
    
    .pdf-chunk-overlay:hover {
        border-width: 2px !important;
        box-shadow: 0 2px 0 #272727 !important;
        border-radius: 8px !important;
    }
}

.subject-card {
    border: 3px solid var(--lib-border);
    border-radius: 24px;
    background-color: var(--lib-card-bg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: var(--lib-transition);
    box-shadow: var(--lib-shadow);
    text-decoration: none;
    box-sizing: border-box;
}

.subject-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--lib-shadow-hover);
}

.subject-card-visual {
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 3px solid var(--lib-border);
    background: linear-gradient(135deg, #E0F2FE 0%, #BAE6FD 100%);
    overflow: hidden;
}

.subject-card-icon {
    max-height: 100px;
    max-width: 100px;
    object-fit: contain;
    transition: var(--lib-transition);
}

.subject-card:hover .subject-card-icon {
    transform: scale(1.1) rotate(4deg);
}

.subject-card-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
    text-align: left;
}

.subject-card-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--lib-dark);
    margin: 0;
    font-family: 'Outfit', sans-serif;
}

.subject-card-desc {
    font-size: 0.85rem;
    color: #666666;
    margin: 0;
    line-height: 1.4;
}

/* Combined Study Workspace & Whiteboard View */
.workspace-root {
    width: 100%;
    height: 100vh;
    background-color: var(--lib-bg);
    padding: 92px 16px 12px 16px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.workspace-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}

.back-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: 3px solid var(--lib-border);
    border-radius: 14px;
    background: var(--lib-card-bg);
    color: var(--lib-dark);
    font-weight: 700;
    text-decoration: none;
    font-size: 0.85rem;
    box-shadow: 0 3px 0 var(--lib-border);
    transition: var(--lib-transition);
}

.back-link-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 0 var(--lib-border);
}

.back-link-btn:active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 var(--lib-border);
}

.workspace-title-info h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--lib-dark);
    margin: 0;
    line-height: 1.1;
}

.workspace-title-info span {
    font-size: 0.8rem;
    color: #666;
    font-weight: 600;
}

/* Main Two-Column Split Layout */
.workspace-layout {
    display: grid;
    grid-template-columns: 1.15fr 1.15fr 0.7fr;
    gap: 16px;
    align-items: stretch;
    flex: 1;
    min-height: 0;
}

@media (max-width: 991.98px) {
    .workspace-layout {
        grid-template-columns: 1fr;
        overflow-y: auto;
    }
}

.workspace-pane {
    background: var(--lib-card-bg);
    border: 3px solid var(--lib-border);
    border-radius: 28px;
    padding: 16px;
    box-shadow: var(--lib-shadow);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

/* Left Pane Layout & Tab Switchers */
.pane-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    gap: 12px;
    flex-wrap: wrap;
}

.workspace-tabs {
    display: flex;
    gap: 8px;
    border: 3px solid var(--lib-border);
    background: #F1F5F9;
    padding: 4px;
    border-radius: 16px;
}

.workspace-tab {
    padding: 8px 18px;
    border: none;
    background: transparent;
    border-radius: 12px;
    font-size: 0.88rem;
    font-weight: 700;
    color: #475569;
    cursor: pointer;
    transition: var(--lib-transition);
}

.workspace-tab.active {
    background: var(--lib-dark);
    color: #FFFFFF;
}

/* Chapters Selector Dropdown */
.chapters-sidebar {
    min-width: 220px;
}

.chapters-dropdown-container {
    position: relative;
    width: 100%;
}

.chapters-select {
    width: 100%;
    padding: 10px 36px 10px 16px;
    border: 3px solid var(--lib-border);
    border-radius: 14px;
    font-size: 0.88rem;
    font-weight: 700;
    background-color: var(--lib-card-bg);
    color: var(--lib-dark);
    cursor: pointer;
    appearance: none;
    outline: none;
    transition: var(--lib-transition);
}

.chapters-select:focus {
    border-color: var(--lib-primary);
}

.chapters-dropdown-container::after {
    content: '▼';
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    color: var(--lib-dark);
    pointer-events: none;
}

/* Left Pane Content Views */
.pane-content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 0;
    overflow: hidden;
}

/* PDF Viewer Frame Container */
.pdf-viewer-container {
    flex: 1 1 0%;
    min-height: 0;
    border: 3px solid var(--lib-border);
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    background-color: #525659;
}

.pdf-viewer-frame {
    width: 100%;
    height: 100%;
    border: none;
    position: absolute;
    top: 0;
    left: 0;
}

/* AI Study Guide (Scrollable text blocks) */
.ai-study-guide-container {
    flex: 1 1 0%;
    min-height: 0;
    max-height: none !important;
    border: 3px solid var(--lib-border);
    border-radius: 20px;
    background-color: #FAFAFA;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ai-study-guide-text-pane {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

/* Page-by-page PDF selection layout */
.pdf-page-container {
    position: relative;
    width: 100%;
    max-width: 680px;
    height: auto;
    margin: 0 auto 32px auto;
    border: 3px solid #272727;
    box-shadow: none;
    border-radius: 20px;
    background: #FFFFFF;
    overflow: visible;
    box-sizing: border-box;
}

.pdf-page-container canvas {
    display: block;
    width: 100% !important;
    height: auto !important;
    border-radius: 16px;
}

.pdf-page-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #FEF3C7;
    border: 2px solid #272727;
    border-radius: 8px;
    padding: 4px 8px;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 0.72rem;
    color: #272727;
    z-index: 10;
    box-shadow: 2px 2px 0 #272727;
    pointer-events: none;
}

.pdf-chunk-overlay {
    position: absolute;
    box-sizing: border-box;
    background-color: rgba(99, 102, 241, 0.03);
    border: 1.5px dashed rgba(99, 102, 241, 0.25);
    border-radius: 8px;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.pdf-chunk-overlay:hover {
    border: 3px solid #272727;
    box-shadow: 0 4px 0 #272727;
    background-color: rgba(254, 240, 138, 0.25) !important;
    border-radius: 12px;
    z-index: 100 !important;
    transform: scale(1.015);
}

.overlay-actions-tooltip {
    position: absolute;
    bottom: 105%;
    left: 50%;
    transform: translateX(-50%) translateY(10px) scale(0.9);
    background: #FFFFFF;
    border: 3px solid #272727;
    box-shadow: 0 6px 0 #272727;
    border-radius: 16px;
    padding: 12px;
    display: none;
    flex-direction: column;
    gap: 8px;
    z-index: 1000;
    pointer-events: auto;
    width: max-content;
    max-width: 420px;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.pdf-chunk-overlay:hover .overlay-actions-tooltip,
.overlay-actions-tooltip.active {
    display: flex;
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1) !important;
}

.overlay-actions-tooltip.pinned {
    border-color: #0A34D3 !important;
    box-shadow: 0 6px 0 #0A34D3 !important;
}

.overlay-actions-tooltip.pinned .tooltip-badge {
    background: #0A34D3 !important;
}

.overlay-tooltip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    border-bottom: 2px dashed rgba(39, 39, 39, 0.1);
    padding-bottom: 6px;
    margin-bottom: 4px;
}

.tooltip-badge {
    background: #272727;
    color: #FFFFFF;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 8px;
    text-transform: uppercase;
    font-family: 'Outfit', sans-serif;
}

.tooltip-ai-indicator {
    color: #16A34A;
    font-size: 0.72rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
}

.overlay-tooltip-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}

.overlay-tooltip-buttons .tooltip-action-btn {
    padding: 5px 10px;
    border: 2px solid #272727;
    border-radius: 8px;
    background: #FFFFFF;
    color: #272727;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 0 #272727;
    transition: all 0.1s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: 'Montserrat', sans-serif;
}

.overlay-tooltip-buttons .tooltip-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 0 #272727;
    background-color: #F8FAFC;
}

.overlay-tooltip-buttons .tooltip-action-btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 0 #272727;
}

.tooltip-action-btn.explain-btn:hover { background-color: #FFE4E6; }
.tooltip-action-btn.summarize-btn:hover { background-color: #E0F2FE; }
.tooltip-action-btn.translate-btn:hover { background-color: #FEF3C7; }
.tooltip-action-btn.quiz-btn:hover { background-color: #F3E8FF; }
.tooltip-action-btn.career-btn:hover { background-color: #DCFCE7; }
.tooltip-action-btn.diagram-btn:hover { background-color: #FFEDD5; }

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Beautiful chunk card container following Neo-Brutalism rules */
.chunk-card {
    border: 3px solid var(--lib-border);
    border-radius: 24px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: none;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: #FFFFFF;
    box-sizing: border-box;
    position: relative;
    translate: 0px;
    rotate: 0deg;
    scale: 1;
}

.chunk-card:hover {
    transform: translateY(-3px) scale(1.01);
    box-shadow: none;
}

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

.chunk-badge {
    background: var(--lib-dark);
    color: #FFFFFF;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 5px 10px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 2px solid var(--lib-border);
}

.chunk-ai-badge {
    background: #F0FDF4;
    color: #16A34A;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    border: 2px solid #16A34A;
}

.chunk-card-text {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.75;
    color: #1E293B;
    user-select: text;
}

.chunk-actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
    border-top: 2px dashed rgba(26,27,36,0.1);
    padding-top: 12px;
}

.chunk-action-btn {
    padding: 6px 12px;
    border: 2px solid var(--lib-border);
    border-radius: 12px;
    background: #FFFFFF;
    color: var(--lib-dark);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
    box-shadow: 0 2px 0 var(--lib-border);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.chunk-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 0 var(--lib-border);
    background-color: #F1F5F9;
}

.chunk-action-btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 0 var(--lib-border);
}

.chunk-card.variant-pink { background: linear-gradient(135deg, #FFE4E6 0%, #FECDD3 100%); }
.chunk-card.variant-blue { background: linear-gradient(135deg, #E0F2FE 0%, #BAE6FD 100%); }
.chunk-card.variant-yellow { background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%); }
.chunk-card.variant-purple { background: linear-gradient(135deg, #F3E8FF 0%, #E9D5FF 100%); }

/* Floating AI Actions Tooltip Toolbar */
.floating-ai-tooltip {
    position: absolute;
    display: none;
    z-index: 1000;
    background: var(--lib-dark);
    border: 2.5px solid #FFFFFF;
    border-radius: 14px;
    padding: 6px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
    align-items: center;
    gap: 4px;
    transform: translate(-50%, -100%);
    margin-top: -10px;
}

.floating-ai-tooltip::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 8px 8px 0;
    border-style: solid;
    border-color: var(--lib-dark) transparent;
    display: block;
    width: 0;
}

.tooltip-action-btn {
    background: transparent;
    border: none;
    color: #E2E8F0;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: var(--lib-transition);
    white-space: nowrap;
}

.tooltip-action-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #FFFFFF;
}

.ai-assistant-card {
    border: 3px solid var(--lib-border);
    border-radius: 20px;
    padding: 20px;
    background: #F0F4FF;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
    flex: 45 1 0%;
    min-height: 0;
    overflow-y: auto;
}

.ai-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 800;
    color: var(--lib-dark);
    font-size: 0.95rem;
    border-bottom: 2px solid rgba(26,27,36,0.1);
    padding-bottom: 8px;
    flex-shrink: 0;
}

.ai-card-body {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #334155;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.ai-welcome-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    height: 100%;
    min-height: 160px;
    box-sizing: border-box;
    gap: 8px;
}

.ai-welcome-icon {
    font-size: 2.2rem;
    animation: bounceWorm 2.5s infinite ease-in-out;
}

@keyframes bounceWorm {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-6px) scale(1.05); }
}

.ai-welcome-placeholder h4 {
    margin: 0;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--lib-dark);
}

.ai-welcome-placeholder p {
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.82rem;
    color: #64748B;
    max-width: 320px;
    line-height: 1.4;
}

/* AI Loader animation */
.ai-pulse-loader {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px 0;
}

.ai-pulse-line {
    height: 12px;
    background: #CBD5E1;
    border-radius: 4px;
    animation: pulseLoader 1.5s infinite;
}
.ai-pulse-line.w-80 { width: 80%; }
.ai-pulse-line.w-100 { width: 100%; }
.ai-pulse-line.w-90 { width: 90%; }

@keyframes pulseLoader {
    0% { opacity: 0.4; }
    50% { opacity: 0.8; }
    100% { opacity: 0.4; }
}

/* Quiz UI cards inside AI responses */
.quiz-question-box {
    font-weight: 800;
    margin-bottom: 12px;
}

.quiz-options-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.quiz-option-btn {
    width: 100%;
    padding: 10px 16px;
    border: 2px solid var(--lib-border);
    border-radius: 10px;
    background: #FFFFFF;
    text-align: left;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    transition: var(--lib-transition);
}

.quiz-option-btn:hover {
    background-color: #F8FAFC;
}

.quiz-option-btn.correct {
    background-color: #DEF7EC;
    border-color: #31C48D;
    color: #03543F;
}

.quiz-option-btn.incorrect {
    background-color: #FDE8E8;
    border-color: #F05252;
    color: #9B1C1C;
}

.quiz-explanation {
    margin-top: 12px;
    font-size: 0.88rem;
    padding: 10px;
    background: #FFFFFF;
    border-left: 4px solid var(--lib-primary);
    border-radius: 4px;
}

/* Right Pane: Endless Drawing Whiteboard UI */
.whiteboard-pane {
    position: relative;
}

.whiteboard-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid var(--lib-border);
    padding-bottom: 16px;
    margin-bottom: 16px;
    gap: 16px;
    flex-wrap: wrap;
}

/* Drawing Toolbar Toolgroups */
.tool-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tool-label {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #888;
    letter-spacing: 0.5px;
}

/* Color Dot Selectors */
.color-swatch-row {
    display: flex;
    gap: 6px;
}

.color-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--lib-transition);
    padding: 0;
    box-sizing: border-box;
}

.color-dot:hover {
    transform: scale(1.1);
}

.color-dot.active {
    border-color: var(--lib-border);
    box-shadow: 0 0 0 2px #FFFFFF, 0 0 0 4px var(--lib-primary);
}

/* Brush Tool Selectors */
.brush-tool-btn {
    width: 34px;
    height: 34px;
    border: 3px solid var(--lib-border);
    border-radius: 10px;
    background: var(--lib-card-bg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--lib-transition);
    padding: 0;
    color: var(--lib-dark);
}

.brush-tool-btn:hover {
    background-color: var(--lib-primary-light);
}

.brush-tool-btn.active {
    background-color: var(--lib-dark);
    color: #FFFFFF;
}

/* Size Buttons */
.size-btn {
    width: 32px;
    height: 32px;
    border: 3px solid var(--lib-border);
    border-radius: 8px;
    background: var(--lib-card-bg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: var(--lib-transition);
}

.size-btn:hover {
    background-color: var(--lib-primary-light);
}

.size-btn.active {
    background-color: var(--lib-primary);
    color: #FFFFFF;
}

.size-dot {
    background-color: currentColor;
    border-radius: 50%;
}

.size-dot.thin { width: 4px; height: 4px; }
.size-dot.medium { width: 8px; height: 8px; }
.size-dot.thick { width: 12px; height: 12px; }

/* Control Buttons (Clear, Undo, Save) */
.ctrl-btn {
    padding: 8px 14px;
    border: 3px solid var(--lib-border);
    border-radius: 12px;
    background: var(--lib-card-bg);
    color: var(--lib-dark);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--lib-transition);
    box-shadow: 0 3px 0 var(--lib-border);
}

.ctrl-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 0 var(--lib-border);
    background-color: #F8FAFC;
}

.ctrl-btn:active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 var(--lib-border);
}

.ctrl-btn.btn-clear {
    border-color: #DC2626;
    color: #DC2626;
    box-shadow: 0 3px 0 #DC2626;
}

.ctrl-btn.btn-clear:hover {
    background-color: #FEF2F2;
}

.ctrl-btn.btn-save {
    background: var(--lib-primary);
    color: #FFFFFF;
}

.ctrl-btn.btn-save:hover {
    background: var(--lib-primary-hover);
}

/* Whiteboard Canvas Element Container */
.canvas-container {
    flex: 1;
    min-height: 0 !important;
    border: 3px solid var(--lib-border);
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    background-color: #FFFFFF;
    user-select: none;
}

.canvas-container.tool-pencil { cursor: default; }
.canvas-container.tool-eraser { cursor: cell; }
.canvas-container.tool-hand { cursor: grab; }
.canvas-container.tool-hand:active { cursor: grabbing; }

.whiteboard-canvas {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    display: block;
}

/* Figma-like Canvas Zoom Controls HUD */
.canvas-zoom-hud {
    position: absolute;
    top: 16px;
    left: 16px;
    bottom: auto;
    right: auto;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid var(--lib-border);
    border-radius: 12px;
    padding: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 100;
}

.zoom-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-weight: 800;
    font-size: 0.95rem;
    color: var(--lib-dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--lib-transition);
}

.zoom-btn:hover {
    background: #E2E8F0;
}

.zoom-text {
    font-size: 0.8rem;
    font-weight: 800;
    padding: 0 6px;
    min-width: 48px;
    text-align: center;
    color: var(--lib-dark);
}

/* Empty State / Fallbacks */
.no-pdf-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 40px;
    text-align: center;
    color: #888;
}

.no-pdf-placeholder svg {
    margin-bottom: 16px;
    color: #AAA;
}

.no-pdf-placeholder h4 {
    font-family: 'Outfit', sans-serif;
    color: var(--lib-dark);
    margin-bottom: 8px;
    font-size: 1.1rem;
}

/* ==========================================
   Study Space Guide Helpers Styling
   ========================================== */

/* Study Space Help Guide FAB */
.floating-help-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #80CBC4;
    border: 3px solid var(--lib-border, #1A1B24);
    border-radius: 50px;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: var(--lib-shadow, 0 4px 0 #1A1B24);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2000;
}

.floating-help-fab:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 0 var(--lib-border, #1A1B24);
}

.floating-help-fab:active {
    transform: translateY(1px);
    box-shadow: 0 2px 0 var(--lib-border, #1A1B24);
}

.floating-help-fab .fab-icon {
    font-size: 1.25rem;
}

.floating-help-fab .fab-label {
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--lib-dark, #1A1B24);
}

/* Slide-out Contextual Help Drawer */
.help-guide-drawer {
    position: fixed;
    top: 0;
    right: -420px; /* Hidden initially */
    width: 380px;
    max-width: 90%;
    height: 100vh;
    background: #FFFFFF;
    border-left: 4px solid var(--lib-border, #1A1B24);
    box-shadow: -10px 0 30px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    z-index: 2500;
    transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
}

.help-guide-drawer.open {
    right: 0;
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px;
    border-bottom: 3px solid var(--lib-border, #1A1B24);
    background: #F4F6F9;
}

.drawer-header h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--lib-dark, #1A1B24);
    margin: 0;
}

.drawer-close-btn {
    background: transparent;
    border: none;
    font-size: 1.4rem;
    font-weight: 800;
    cursor: pointer;
    color: var(--lib-dark, #1A1B24);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.drawer-close-btn:hover {
    transform: scale(1.15);
}

.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.drawer-body h4 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--lib-dark, #1A1B24);
    margin: 0 0 4px 0;
}

.drawer-body p, .drawer-body li {
    font-size: 0.88rem;
    color: #475569;
    line-height: 1.5;
    margin: 0;
}

.drawer-body ul {
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.subject-tips-card {
    background: #FFFBEB;
    border: 2px dashed #F59E0B;
    border-radius: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* AI Assistant Pane specific rules */
.ai-assistant-pane {
    background: #F0F4FF !important;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-sizing: border-box;
}

.ai-assistant-pane .ai-assistant-card {
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    box-shadow: none !important;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow-y: auto;
}

.ai-assistant-pane .ai-card-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.ai-assistant-pane .ai-welcome-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Dismiss Nav Bar, Top Announcement Banner, and Footer when inside Whiteboard Workspace */
html.whiteboard-active-mode #topFreeTrialBar,
body.whiteboard-active-mode #topFreeTrialBar,
html.whiteboard-active-mode .top-free-trial-bar,
body.whiteboard-active-mode .top-free-trial-bar,
html.whiteboard-active-mode header,
body.whiteboard-active-mode header,
html.whiteboard-active-mode .header-transparent,
body.whiteboard-active-mode .header-transparent,
html.whiteboard-active-mode footer,
body.whiteboard-active-mode footer,
html.whiteboard-active-mode .footer,
body.whiteboard-active-mode .footer {
    display: none !important;
}

html.whiteboard-active-mode,
body.whiteboard-active-mode {
    overflow: hidden !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Ensure the horizontal top nav bar has a solid primary color background when on the Hub */
body:not(.whiteboard-active-mode) header, 
body:not(.whiteboard-active-mode) .header-transparent {
    background-color: #5F5AF6 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15) !important;
    backdrop-filter: blur(12px) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1) !important;
    display: flex !important;
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: 80px !important;
    z-index: 2000 !important;
    transition: top 0.3s ease !important;
}

body:not(.scrolled-nav):not(.body-page-onboarding):not(.whiteboard-active-mode):not(.user-is-teacher) header, 
body:not(.scrolled-nav):not(.body-page-onboarding):not(.whiteboard-active-mode):not(.user-is-teacher) .header-transparent {
    top: 40px !important;
}

body.scrolled-nav header, 
body.scrolled-nav .header-transparent,
html.user-is-teacher header,
body.user-is-teacher header,
html.user-is-teacher .header-transparent,
body.user-is-teacher .header-transparent {
    top: 0 !important;
}

@media (max-width: 768px) {
    body:not(.scrolled-nav):not(.body-page-onboarding):not(.whiteboard-active-mode):not(.user-is-teacher) header, 
    body:not(.scrolled-nav):not(.body-page-onboarding):not(.whiteboard-active-mode):not(.user-is-teacher) .header-transparent {
        top: 38px !important;
    }
}

/* Adjust top padding of the workspace root and hub to beautifully clear the solid 80px high top nav bar and 40px top banner */
.workspace-root {
    padding-top: 136px !important;
}

.workspace-tiles-hub {
    padding-top: 144px !important;
}

body.scrolled-nav .workspace-root,
body.user-is-teacher .workspace-root {
    padding-top: 96px !important;
}

body.scrolled-nav .workspace-tiles-hub,
body.user-is-teacher .workspace-tiles-hub {
    padding-top: 104px !important;
}

/* --- NEOBRUTALIST LOCK & WORKSPACE HUB STYLES --- */

/* Lock Screen overlay and button transition animations */
#workspaceGuestLockScreen .btn-lock-login:hover {
    transform: translateY(-2px);
    box-shadow: 6px 6px 0 #1A1B24 !important;
    background: #0624A3 !important;
}
#workspaceGuestLockScreen .btn-lock-login:active {
    transform: translateY(2px);
    box-shadow: 2px 2px 0 #1A1B24 !important;
}

/* Spinner keyframe */
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Textbook PDF snapshot button style overlay */
.pdf-page-container {
    position: relative; /* Anchor for page badge and snapshot button */
}

.pdf-snapshot-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 50;
    background: #FFFFFF;
    border: 2.5px solid #1A1B24;
    border-radius: 10px;
    padding: 7px 14px;
    font-weight: 800;
    font-size: 0.8rem;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    box-shadow: 3px 3px 0 #1A1B24;
    transition: all 0.12s ease-in-out;
}

.pdf-snapshot-btn:hover {
    transform: translateY(-1.5px);
    box-shadow: 5px 5px 0 #1A1B24;
    background: #FFFBEB;
}

.pdf-snapshot-btn:active {
    transform: translateY(1.5px);
    box-shadow: 1px 1px 0 #1A1B24;
}

/* Dynamic Hub Tiles Grid dashboard */
.hub-tile-card {
    background: #FFFFFF;
    border: 3.5px solid #1A1B24;
    border-radius: 20px;
    padding: 30px;
    box-shadow: none;
    transition: all 0.16s cubic-bezier(0.175, 0.885, 0.32, 1.1);
    display: flex;
    flex-direction: column;
    position: relative;
}

.hub-tile-card:hover {
    transform: translateY(-5px);
    box-shadow: none;
}

.hub-tile-icon {
    width: 60px;
    height: 60px;
    border: 3px solid #1A1B24;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-bottom: 22px;
    box-shadow: none;
}

.hub-tile-badge {
    position: absolute;
    top: 30px;
    right: 30px;
    padding: 5px 12px;
    font-size: 0.75rem;
    font-weight: 900;
    border-radius: 8px;
    font-family: 'Outfit', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hub-tile-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 900;
    font-size: 1.45rem;
    color: #1A1B24;
    margin: 0 0 6px 0;
    line-height: 1.15;
}

.hub-tile-teacher {
    font-size: 0.95rem;
    color: #4B5563;
    margin: 0 0 20px 0;
    font-family: 'Poppins', sans-serif;
}

.hub-tile-status {
    font-size: 0.84rem;
    font-weight: 800;
    color: #16A34A;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Outfit', sans-serif;
}

.hub-tile-btn {
    width: 100%;
    color: white;
    border: 3px solid #1A1B24;
    border-radius: 14px;
    padding: 13px;
    font-weight: 900;
    font-size: 0.98rem;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    transition: all 0.12s ease-in-out;
    margin-top: auto;
}

.hub-tile-btn:hover {
    transform: translateY(-2px);
    box-shadow: 4px 4px 0 #1A1B24 !important;
}

.hub-tile-btn:active {
    transform: translateY(2px);
    box-shadow: 1px 1px 0 #1A1B24 !important;
}

/* ==========================================================================
   FIGJAM COLLABORATIVE WORKSPACE ENGINE STYLES
   Matches FigJam Whiteboard & PDF Interactive Studio Experience
   ========================================================================== */

/* FigJam Container - Full Screen Whiteboard Workspace */
.figjam-container,
html.whiteboard-active-mode .figjam-container,
body.whiteboard-active-mode .figjam-container {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    overflow: hidden;
    background-color: #F8F9FB;
    font-family: 'Outfit', 'Poppins', -apple-system, sans-serif;
    user-select: none;
    z-index: 100;
}

/* --- TOP APPLICATION BAR --- */
.figjam-topbar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 54px;
    background: #FFFFFF;
    border-bottom: 2px solid #1A1B24;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 300;
    box-sizing: border-box;
}

.figjam-topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.figjam-back-btn {
    width: 32px;
    height: 32px;
    border: 2px solid #1A1B24;
    border-radius: 8px;
    background: #FFFFFF;
    color: #1A1B24;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.12s ease;
}

.figjam-back-btn:hover {
    background: #F3F4F6;
    transform: translateY(-1px);
}

.figjam-file-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.figjam-file-icon {
    font-size: 18px;
}

.figjam-file-name {
    font-weight: 800;
    font-size: 0.95rem;
    color: #1A1B24;
    border: none;
    background: transparent;
    padding: 4px 8px;
    border-radius: 6px;
    font-family: 'Outfit', sans-serif;
    min-width: 260px;
    width: 480px;
    max-width: 580px;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    transition: width 0.15s ease;
}

.figjam-file-name:focus {
    background: #F3F4F6;
    outline: 2px solid #5F5AF6;
    width: 540px;
    max-width: 620px;
}

.figjam-saved-pill {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: #16A34A;
    font-weight: 700;
    background: #F0FDF4;
    padding: 3px 8px;
    border-radius: 6px;
    border: 1.5px solid #16A34A;
}

.figjam-topbar-right,
.topbar-right-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.figjam-icon-btn {
    width: 34px;
    height: 34px;
    border: 2px solid #1A1B24;
    border-radius: 8px;
    background: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
    transition: all 0.12s ease;
}

.figjam-icon-btn:hover {
    background: #F3F4F6;
    transform: translateY(-1px);
}

.figjam-avatar-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #1A1B24;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 12px;
    color: #FFFFFF;
    cursor: pointer;
    overflow: hidden;
}

.figjam-avatar-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- ACTIVE USER AVATAR TOOLTIPS --- */
.figjam-avatar-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.figjam-avatar-tooltip {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: #111827;
    color: #FFFFFF;
    padding: 6px 12px;
    border-radius: 8px;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 0.78rem;
    line-height: 1.3;
    white-space: nowrap;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.12);
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.16s cubic-bezier(0.16, 1, 0.3, 1), transform 0.16s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.16s;
    z-index: 600;
    display: flex;
    align-items: center;
    gap: 7px;
}

/* Tooltip upward arrow */
.figjam-avatar-tooltip::before {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: transparent transparent #111827 transparent;
}

.figjam-avatar-wrapper:hover .figjam-avatar-tooltip,
.figjam-avatar-wrapper:focus-within .figjam-avatar-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.avatar-tooltip-name {
    color: #FFFFFF;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.avatar-tooltip-role {
    color: #94A3B8;
    font-size: 0.72rem;
    font-weight: 600;
    padding-left: 6px;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.avatar-tooltip-badge-active {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10B981;
    display: inline-block;
    box-shadow: 0 0 8px #10B981;
    flex-shrink: 0;
}

.avatar-tooltip-badge-offline {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #94A3B8;
    display: inline-block;
    flex-shrink: 0;
}

.figjam-save-btn {
    background: #5F5AF6;
    color: #FFFFFF;
    border: 2px solid #1A1B24;
    border-radius: 8px;
    padding: 6px 14px;
    font-weight: 800;
    font-size: 0.88rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Outfit', sans-serif;
    box-shadow: 2px 2px 0 #1A1B24;
    transition: all 0.12s ease;
}

.figjam-save-btn:hover {
    background: #4F46E5;
    transform: translateY(-1px);
    box-shadow: 3px 3px 0 #1A1B24;
}

.figjam-save-btn:active {
    transform: translateY(1px);
    box-shadow: 1px 1px 0 #1A1B24;
}

/* --- LEFT VERTICAL TOOL RAIL --- */
/* --- LEFT VERTICAL TOOL RAIL (Deprecated in favor of contextual tool pill) --- */
.figjam-left-rail {
    display: none !important;
}

/* --- BOTTOM FLOATING PILL TOOLBAR --- */
.figjam-bottom-pill {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #FFFFFF;
    border: 2.5px solid #1A1B24;
    border-radius: 20px;
    padding: 6px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: calc(100vw - 40px);
    box-sizing: border-box;
    z-index: 250;
    box-shadow: 4px 4px 0 #1A1B24;
    transition: left 0.25s cubic-bezier(0.16, 1, 0.3, 1), max-width 0.25s cubic-bezier(0.16, 1, 0.3, 1), padding 0.2s ease, gap 0.2s ease;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.figjam-bottom-pill::-webkit-scrollbar {
    display: none;
}

/* Accommodate open properties drawer without cutting off toolbar */
body.has-properties-open .figjam-bottom-pill {
    left: calc((100% - 290px) / 2);
    max-width: calc(100vw - 320px);
    gap: 6px;
    padding: 5px 10px;
}

@media (max-width: 1200px) {
    .figjam-bottom-pill {
        gap: 6px;
        padding: 5px 8px;
    }
    .figjam-pill-item {
        padding: 5px 7px;
    }
    .figjam-pill-label {
        font-size: 0.64rem;
    }
    body.has-properties-open .figjam-bottom-pill {
        left: calc((100% - 270px) / 2);
        max-width: calc(100vw - 295px);
        gap: 4px;
        padding: 4px 6px;
    }
}

.figjam-pill-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 10px;
    border-radius: 10px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.12s ease;
    color: #1A1B24;
    flex-shrink: 0;
}

.figjam-pill-item:hover {
    background: #F3F4F6;
}

.figjam-pill-item.active {
    background: #E0E7FF;
    border-color: #5F5AF6;
    color: #4338CA;
}

.figjam-pill-icon {
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.figjam-pill-label {
    font-size: 0.68rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.2px;
    white-space: nowrap;
}

/* --- RIGHT DYNAMIC TOOL PROPERTIES & ASSETS PANEL --- */
.figjam-assets-panel {
    position: absolute;
    top: 54px;
    right: 0;
    width: 340px;
    bottom: 0;
    background: #FFFFFF;
    border-left: 2.5px solid #1A1B24;
    z-index: 280;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 16px rgba(0,0,0,0.08);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.figjam-assets-panel.collapsed {
    transform: translateX(105%);
    pointer-events: none;
}

.figjam-assets-header {
    padding: 14px 18px;
    border-bottom: 2px solid #1A1B24;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #F8FAFC;
}

.figjam-assets-header h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 900;
    color: #1A1B24;
    font-family: 'Outfit', sans-serif;
    display: flex;
    align-items: center;
    gap: 8px;
}

.figjam-assets-close {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    border: 1.5px solid #1A1B24;
    background: #FFFFFF;
    font-size: 13px;
    cursor: pointer;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.1s ease;
}

.figjam-assets-close:hover {
    background: #FEE2E2;
    color: #DC2626;
    border-color: #DC2626;
}

.figjam-assets-body {
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 18px;
    flex: 1;
}

.figjam-prop-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.figjam-prop-title {
    font-size: 0.76rem;
    font-weight: 900;
    color: #1A1B24;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: 'Outfit', sans-serif;
}

.figjam-color-palette {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.figjam-color-swatch-item {
    width: 100%;
    height: 34px;
    border-radius: 8px;
    border: 2px solid #1A1B24;
    cursor: pointer;
    position: relative;
    transition: all 0.12s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 2px 2px 0 #1A1B24;
    box-sizing: border-box;
}

.figjam-color-swatch-item:hover {
    transform: translateY(-2px);
    box-shadow: 3px 3px 0 #1A1B24;
}

.figjam-color-swatch-item.active {
    outline: 3px solid #5F5AF6;
    outline-offset: 2px;
}

.figjam-thickness-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(58px, 1fr));
    gap: 8px;
}

.figjam-thickness-btn {
    min-height: 56px;
    padding: 8px 4px;
    border: 2px solid #1A1B24;
    border-radius: 10px;
    background: #F8FAFC;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-family: 'Outfit', sans-serif;
    transition: all 0.12s ease;
    box-shadow: 2px 2px 0 #1A1B24;
    box-sizing: border-box;
    overflow: hidden;
    line-height: 1.15;
    text-align: center;
}

.figjam-thickness-btn:hover {
    background: #E0E7FF;
}

.figjam-thickness-btn.active {
    background: #5F5AF6;
    color: #FFFFFF;
    border-color: #1A1B24;
}

.figjam-thickness-btn .thickness-preview-pill {
    background: currentColor;
    border-radius: 3px;
    margin-bottom: 2px;
}

.figjam-thickness-btn .thickness-icon {
    font-size: 16px;
    line-height: 1;
    margin-bottom: 1px;
}

.figjam-thickness-btn .thickness-label {
    font-size: 0.74rem;
    font-weight: 800;
    color: #1A1B24;
}

.figjam-thickness-btn .thickness-sub {
    font-size: 0.64rem;
    font-weight: 700;
    color: #64748B;
}

.figjam-thickness-btn.active .thickness-label,
.figjam-thickness-btn.active .thickness-sub {
    color: #FFFFFF;
}

.figjam-slider-control {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #F8FAFC;
    border: 2px solid #1A1B24;
    border-radius: 10px;
    padding: 8px 12px;
}

.figjam-slider-input {
    flex: 1;
    accent-color: #5F5AF6;
    cursor: pointer;
}

.figjam-slider-val {
    font-size: 0.78rem;
    font-weight: 900;
    color: #1A1B24;
    min-width: 36px;
    text-align: right;
    font-family: 'Outfit', sans-serif;
}

.figjam-preview-box {
    border: 2px solid #1A1B24;
    border-radius: 10px;
    padding: 10px;
    background: #F8FAFC;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.figjam-preview-line-canvas {
    width: 100%;
    height: 32px;
    background: #FFFFFF;
    border: 1.5px solid #CBD5E1;
    border-radius: 6px;
}

.figjam-template-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.figjam-template-btn {
    border: 2px solid #1A1B24;
    border-radius: 8px;
    background: #FFFFFF;
    padding: 8px 12px;
    font-size: 0.78rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    text-align: left;
    cursor: pointer;
    box-shadow: 2px 2px 0 #1A1B24;
    transition: all 0.1s ease;
}

.figjam-template-btn:hover {
    background: #FEF08A;
    transform: translateY(-1px);
    box-shadow: 3px 3px 0 #1A1B24;
}

.figjam-add-btn {
    border: 2.5px solid #1A1B24;
    border-radius: 10px;
    background: #5F5AF6;
    color: #FFFFFF;
    padding: 10px;
    font-size: 0.84rem;
    font-weight: 900;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    box-shadow: 3px 3px 0 #1A1B24;
    transition: all 0.12s ease;
    text-align: center;
}

.figjam-add-btn:hover {
    background: #4F46E5;
    transform: translateY(-1px);
    box-shadow: 4px 4px 0 #1A1B24;
}

.figjam-shapes-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
}

.figjam-shape-card {
    min-height: 58px;
    border: 2px solid #1A1B24;
    border-radius: 10px;
    background: #FFFFFF;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 4px;
    cursor: pointer;
    transition: all 0.12s ease;
    box-shadow: 2px 2px 0 #1A1B24;
    user-select: none;
    box-sizing: border-box;
}

.figjam-shape-card .figjam-shape-icon {
    font-size: 20px;
    line-height: 1;
    color: #1A1B24;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 24px;
}

.figjam-shape-card .figjam-shape-icon svg {
    display: block;
    stroke: currentColor;
    color: #1A1B24;
    transition: color 0.12s ease, transform 0.12s ease;
}

.figjam-shape-card .figjam-shape-name {
    font-size: 0.72rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    color: #1A1B24;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.figjam-shape-card:hover {
    background: #F1F5F9;
    border-color: #4F46E5;
    transform: translateY(-1px);
    box-shadow: 3px 3px 0 #1A1B24;
}

.figjam-shape-card:hover .figjam-shape-icon svg {
    color: #4F46E5;
}

.figjam-shape-card.active {
    background: #EEF2FF;
    border-color: #4F46E5;
    box-shadow: 0 0 0 2px #4F46E5, 2px 2px 0 #1A1B24;
}

.figjam-shape-card.active .figjam-shape-icon svg {
    color: #4338CA;
}

.figjam-shape-card.active .figjam-shape-name {
    color: #4338CA;
}

.figjam-math-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.figjam-math-symbol-btn {
    height: 42px;
    border: 2px solid #1A1B24;
    border-radius: 8px;
    background: #F8FAFC;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 17px;
    font-family: 'KaTeX_Math', 'Times New Roman', serif;
    font-weight: 700;
    transition: all 0.12s ease;
    box-shadow: 2px 2px 0 #1A1B24;
}

.figjam-math-symbol-btn:hover {
    background: #FEF3C7;
    border-color: #D97706;
    transform: scale(1.05);
}

.figjam-icons-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.figjam-icon-card {
    height: 42px;
    border: 2px solid #1A1B24;
    border-radius: 8px;
    background: #F8FAFC;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.12s ease;
    box-shadow: 2px 2px 0 #1A1B24;
}

.figjam-icon-card:hover {
    background: #E0E7FF;
    transform: scale(1.05);
}

.figjam-text-styles-row {
    display: flex;
    gap: 12px;
    align-items: baseline;
    padding: 8px;
}

.figjam-text-style-item {
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
}

/* --- BOTTOM RIGHT OVERLAYS --- */
.figjam-collaborators-card {
    position: absolute;
    bottom: 84px;
    right: 288px;
    background: #FFFFFF;
    border: 2.5px solid #1A1B24;
    border-radius: 16px;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 240;
    box-shadow: 3px 3px 0 #1A1B24;
    min-width: 170px;
}

.figjam-collab-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.figjam-collab-user {
    display: flex;
    align-items: center;
    gap: 8px;
}

.figjam-collab-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1.5px solid #1A1B24;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    color: white;
    overflow: hidden;
}

.figjam-collab-name {
    font-size: 0.8rem;
    font-weight: 800;
    color: #1A1B24;
    font-family: 'Outfit', sans-serif;
}

.figjam-collab-status {
    font-size: 0.72rem;
    font-weight: 700;
    color: #16A34A;
    display: flex;
    align-items: center;
    gap: 4px;
}

.figjam-collab-status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #16A34A;
    display: inline-block;
}

.figjam-mitra-pill {
    display: none !important;
}

/* --- CANVAS VIEWPORT & WORLD SURFACE --- */
.figjam-viewport {
    position: absolute;
    top: 54px;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    background-color: #F8F9FB;
    background-image: radial-gradient(#CBD5E1 1.4px, transparent 1.4px);
    background-size: 24px 24px;
    cursor: default;
}

.figjam-viewport.panning {
    cursor: grab;
}

.figjam-viewport.panning:active {
    cursor: grabbing;
}

.figjam-world {
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: 0 0;
    will-change: transform;
    width: 14000px;
    height: 10000px;
}

/* --- FLOATING FRAMES (PDF & WHITEBOARD) --- */
.figjam-frame {
    position: absolute;
    background: #FFFFFF;
    border: 3px solid #1A1B24;
    border-radius: 20px;
    box-shadow: 6px 6px 0 #1A1B24;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 20;
}

.figjam-frame-header {
    background: #FFFFFF;
    border-bottom: 2.5px solid #1A1B24;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: grab;
    user-select: none;
}

.figjam-frame-header:active {
    cursor: grabbing;
}

.figjam-frame-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 900;
    font-size: 1.15rem;
    color: #1A1B24;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.figjam-frame-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.figjam-frame-btn {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: 1.5px solid #1A1B24;
    background: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.1s ease;
}

.figjam-frame-btn:hover {
    background: #F3F4F6;
}

.figjam-frame.frame-pdf {
    top: 60px;
    left: 40px;
    width: 440px;
    height: 720px;
}

.figjam-pdf-toolbar-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #F8FAFC;
    border-bottom: 2px solid #1A1B24;
    box-sizing: border-box;
}

.figjam-select-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.figjam-select-label {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #64748B;
    letter-spacing: 0.5px;
    font-family: 'Outfit', sans-serif;
}

.figjam-dropdown-select {
    width: 100%;
    padding: 5px 8px;
    background: #FFFFFF;
    border: 2px solid #1A1B24;
    border-radius: 8px;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 0.78rem;
    color: #1A1B24;
    outline: none;
    cursor: pointer;
    box-shadow: 2px 2px 0 #1A1B24;
    box-sizing: border-box;
    transition: all 0.12s ease;
}

.figjam-dropdown-select:hover {
    background: #FFFBEB;
}

.figjam-dropdown-select:focus {
    border-color: #5F5AF6;
    box-shadow: 2px 2px 0 #5F5AF6;
}

.figjam-pdf-container {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    background: #FAFAFA;
    min-height: 0;
    overflow: hidden;
}

.figjam-pdf-iframe {
    width: 100%;
    height: 100%;
    border: none;
    flex: 1;
    background: #525659;
}

.figjam-pdf-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    z-index: 10;
}

.figjam-pdf-body {
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 1;
    background: #FAFAFA;
}

.figjam-chunk-card {
    background: #FFFFFF;
    border: 2px solid #1A1B24;
    border-radius: 12px;
    padding: 14px;
    box-shadow: 2px 2px 0 #1A1B24;
    position: relative;
}

.figjam-chunk-card h4 {
    font-family: 'Outfit', sans-serif;
    font-size: 0.88rem;
    font-weight: 800;
    color: #1A1B24;
    margin: 0 0 6px 0;
}

.figjam-chunk-card p {
    font-size: 0.76rem;
    color: #4B5563;
    line-height: 1.45;
    margin: 0 0 10px 0;
    font-family: 'Poppins', sans-serif;
}

.figjam-chunk-footer {
    display: flex;
    justify-content: flex-end;
}

.figjam-extract-btn {
    background: #FFFFFF;
    border: 2px solid #1A1B24;
    border-radius: 8px;
    padding: 4px 12px;
    font-weight: 800;
    font-size: 0.74rem;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    box-shadow: 2px 2px 0 #1A1B24;
    transition: all 0.1s ease;
}

.figjam-extract-btn:hover {
    background: #E0E7FF;
    border-color: #5F5AF6;
    transform: translateY(-1px);
}

.figjam-extract-btn:active {
    transform: translateY(1px);
    box-shadow: 1px 1px 0 #1A1B24;
}

.figjam-frame.frame-whiteboard {
    top: 60px;
    left: 900px;
    width: 440px;
    height: 720px;
}

.figjam-whiteboard-body {
    flex: 1;
    position: relative;
    background-color: #FFFFFF;
    background-image: 
        linear-gradient(#E2E8F0 1px, transparent 1px),
        linear-gradient(90deg, #E2E8F0 1px, transparent 1px);
    background-size: 20px 20px;
    background-position: -1px -1px;
    overflow: hidden;
}

.figjam-whiteboard-canvas {
    width: 100%;
    height: 100%;
    display: block;
    background: transparent;
    touch-action: none;
    cursor: default;
}

.figjam-whiteboard-canvas.custom-cursor-active,
.figjam-viewport.custom-cursor-active,
.figjam-viewport.custom-cursor-active .figjam-world-whiteboard-canvas {
    cursor: none !important;
}

/* --- CIRCULAR BRUSH & ERASER SIZE PREVIEW CURSOR --- */
.figjam-brush-cursor {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    display: none;
    z-index: 220;
    box-sizing: border-box;
    will-change: left, top, width, height;
}

.figjam-brush-cursor::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 2px;
    height: 2px;
    border-radius: 50%;
    background: currentColor;
    transform: translate(-50%, -50%);
    opacity: 0.7;
}

.figjam-brush-cursor.tool-pencil {
    border: 1.5px solid #1A1B24;
    background: rgba(26, 27, 36, 0.12);
    color: #1A1B24;
}

.figjam-brush-cursor.tool-highlighter {
    border: 2px solid rgba(161, 98, 7, 0.65);
    background: rgba(250, 204, 21, 0.35);
    color: rgba(161, 98, 7, 0.85);
}

.figjam-brush-cursor.tool-eraser {
    border: 2px dashed #DC2626;
    background: rgba(254, 226, 226, 0.45);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.9);
    color: #DC2626;
}

/* --- CENTER TITLE & STICKY NOTES / MINDMAP (HIDDEN FOR PURE CANVAS) --- */
.figjam-center-title {
    display: none !important;
    position: absolute;
    top: 360px;
    left: 670px;
    transform: translateX(-50%);
    text-align: center;
    font-family: 'Outfit', sans-serif;
    font-weight: 900;
    font-size: 1.35rem;
    color: #1A1B24;
    line-height: 1.15;
    letter-spacing: -0.5px;
    text-transform: uppercase;
    z-index: 10;
    pointer-events: none;
}

.figjam-sticky-note {
    position: absolute;
    min-width: 100px;
    min-height: 70px;
    padding: 10px 12px 14px 12px;
    border: 2.5px solid #1A1B24;
    border-radius: 12px;
    box-shadow: 4px 4px 0 #1A1B24;
    font-size: 0.8rem;
    font-weight: 800;
    line-height: 1.35;
    font-family: 'Outfit', sans-serif;
    cursor: move;
    z-index: 15;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    user-select: none;
    transition: box-shadow 0.12s ease;
}

.figjam-sticky-note:hover {
    box-shadow: 6px 6px 0 #1A1B24;
}

.figjam-sticky-delete {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1.5px solid #1A1B24;
    background: #FFFFFF;
    color: #1A1B24;
    font-size: 11px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.15s ease;
    z-index: 6;
    padding: 0;
    line-height: 1;
}

.figjam-sticky-delete:hover {
    opacity: 1;
    background: #DC2626;
    color: #FFFFFF;
    border-color: #DC2626;
    transform: scale(1.15);
}

.figjam-sticky-text {
    flex: 1;
    outline: none;
    word-break: break-word;
    overflow-y: auto;
    cursor: text;
    user-select: text;
    font-size: inherit;
    font-family: inherit;
    font-weight: inherit;
    margin-right: 12px;
}

.figjam-sticky-resize {
    position: absolute;
    bottom: 2px;
    right: 3px;
    font-size: 11px;
    color: #1A1B24;
    opacity: 0.45;
    cursor: se-resize;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    user-select: none;
    z-index: 6;
    line-height: 1;
}

.figjam-sticky-resize:hover {
    opacity: 1;
    color: #5F5AF6;
    transform: scale(1.2);
}

.sticky-yellow { background: #FEF08A; }
.sticky-blue { background: #BAE6FD; }
.sticky-green { background: #BBF7D0; }
.sticky-pink { background: #FBCFE8; }
.sticky-purple { background: #E9D5FF; }
.sticky-coral { background: #FECDD3; }

.figjam-mindmap-node {
    position: absolute;
    padding: 8px 14px;
    border: 2px solid #1A1B24;
    border-radius: 20px;
    background: #FFFFFF;
    font-size: 0.72rem;
    font-weight: 800;
    box-shadow: 2.5px 2.5px 0 #1A1B24;
    cursor: move;
    z-index: 15;
    text-align: center;
    font-family: 'Outfit', sans-serif;
}

/* --- SVG CONNECTOR LINES --- */
.figjam-connectors-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 8;
}

/* --- MULTIPLAYER REAL-TIME CURSORS --- */
.figjam-cursor {
    position: absolute;
    z-index: 100;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    transition: transform 0.08s linear;
}

.figjam-cursor-pointer {
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 16px solid;
    transform: rotate(-45deg);
    transform-origin: 0 0;
}

.figjam-cursor-badge {
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 800;
    color: #FFFFFF;
    font-family: 'Outfit', sans-serif;
    margin-top: 2px;
    margin-left: 12px;
    box-shadow: 1px 1px 0 #1A1B24;
    white-space: nowrap;
}

.cursor-alex .figjam-cursor-pointer { border-top-color: #16A34A; }
.cursor-alex .figjam-cursor-badge { background: #16A34A; }

.cursor-rahul .figjam-cursor-pointer { border-top-color: #2563EB; }
.cursor-rahul .figjam-cursor-badge { background: #2563EB; }

.cursor-sara .figjam-cursor-pointer { border-top-color: #9333EA; }
.cursor-sara .figjam-cursor-badge { background: #9333EA; }

/* --- RESPONSIVE ADAPTATIONS ACROSS ALL SCREEN SIZES --- */
@media (max-width: 1024px) {
    .figjam-topbar-center .figjam-doc-title {
        max-width: 160px;
        font-size: 0.78rem;
    }
    .figjam-frame.frame-pdf {
        width: 480px;
        height: 640px;
    }
    .figjam-frame.frame-whiteboard {
        width: 380px;
        height: 640px;
        left: 540px;
    }
    .figjam-assets-panel {
        width: 270px;
    }
}

@media (max-width: 768px) {
    .figjam-topbar {
        height: 48px;
        padding: 0 8px;
        gap: 6px;
    }
    .figjam-viewport {
        top: 48px;
    }
    .figjam-topbar-left .figjam-logo-badge {
        font-size: 0.74rem;
        padding: 3px 6px;
    }
    .figjam-topbar-center {
        display: none;
    }
    .figjam-btn-tool {
        padding: 5px 8px;
        font-size: 0.75rem;
    }
    .figjam-btn-tool span.btn-label {
        display: none;
    }
    .figjam-bottom-pill {
        bottom: 12px;
        max-width: 94vw;
        padding: 4px 6px;
        gap: 4px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .figjam-bottom-pill::-webkit-scrollbar {
        display: none;
    }
    body.has-properties-open .figjam-bottom-pill {
        left: 50%;
        transform: translateX(-50%);
        max-width: 94vw;
        gap: 3px;
        padding: 3px 5px;
    }
    .figjam-pill-item {
        padding: 4px 6px;
        min-width: 40px;
    }
    .figjam-pill-icon {
        font-size: 16px;
    }
    .figjam-pill-label {
        font-size: 0.6rem;
    }
    .figjam-assets-panel {
        top: 48px;
        width: min(300px, 86vw);
    }
    .figjam-frame.frame-pdf {
        width: 330px;
        height: 480px;
    }
    .figjam-frame.frame-whiteboard {
        width: 310px;
        height: 480px;
        left: 350px;
    }
    .canvas-zoom-hud {
        top: 12px;
        left: 12px;
        padding: 3px 5px;
        gap: 2px;
    }
}

.save-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 12px;
    border: 2.5px solid #1A1B24;
    font-size: 0.82rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    box-shadow: 2px 2px 0 #1A1B24;
    transition: all 0.2s ease-in-out;
}

.save-status-badge.saved {
    background: #F0FDF4;
    color: #16A34A;
    border-color: #1A1B24;
}

.save-status-badge.saving {
    background: #FFFBEB;
    color: #D97706;
    border-color: #1A1B24;
}

.save-status-badge.unsaved {
    background: #F8FAFC;
    color: #64748B;
    border-color: #1A1B24;
}

.btn-topbar-save {
    background: #4F46E5;
    color: #FFFFFF;
    border: 2.5px solid #1A1B24;
    border-radius: 12px;
    padding: 8px 18px;
    font-weight: 800;
    font-size: 0.9rem;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    box-shadow: 3px 3px 0 #1A1B24;
    transition: all 0.12s ease-in-out;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-topbar-save:hover {
    transform: translateY(-2px);
    box-shadow: 5px 5px 0 #1A1B24;
    background: #4338CA;
}

.btn-topbar-save:active {
    transform: translateY(2px);
    box-shadow: 1px 1px 0 #1A1B24;
}

.btn-topbar-export {
    background: #FFFFFF;
    color: #1A1B24;
    border: 2.5px solid #1A1B24;
    border-radius: 12px;
    padding: 8px 18px;
    font-weight: 800;
    font-size: 0.9rem;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    box-shadow: 3px 3px 0 #1A1B24;
    transition: all 0.12s ease-in-out;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-topbar-export:hover {
    transform: translateY(-2px);
    box-shadow: 5px 5px 0 #1A1B24;
    background: #F1F5F9;
}

.btn-topbar-export:active {
    transform: translateY(2px);
    box-shadow: 1px 1px 0 #1A1B24;
}

/* --- Live Multi-User Collaborative Cursors --- */
.live-cursor-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 60;
    overflow: hidden;
}

.remote-cursor {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    transition: left 0.04s ease-out, top 0.04s ease-out, opacity 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    z-index: 65;
}

.remote-cursor.faded {
    opacity: 0.25;
}

.remote-cursor-arrow {
    width: 22px;
    height: 22px;
    filter: drop-shadow(1px 2px 0px rgba(26,27,36,0.7));
}

.remote-cursor-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border: 2px solid #1A1B24;
    border-radius: 8px;
    font-size: 0.72rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    color: #FFFFFF;
    box-shadow: 2px 2px 0 #1A1B24;
    white-space: nowrap;
    margin-top: 2px;
    margin-left: 12px;
}

/* --- Live Active Presence Badge --- */
.presence-pill-container {
    position: absolute;
    top: 72px;
    right: 24px;
    background: rgba(255, 255, 255, 0.96);
    border: 3px solid #1A1B24;
    border-radius: 18px;
    padding: 8px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: 4px 4px 0 #1A1B24;
    z-index: 85;
    backdrop-filter: blur(8px);
    max-width: 260px;
    pointer-events: none;
}

.presence-user-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    color: #1A1B24;
}

.presence-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid #1A1B24;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    font-weight: 800;
    font-size: 0.7rem;
    flex-shrink: 0;
}

.presence-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #16A34A;
    display: inline-block;
    animation: presencePulse 1.8s infinite ease-in-out;
}

@keyframes presencePulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.4); opacity: 0.6; }
}

/* --- Subscription / Class Concluded View-Only Banner --- */
.subscription-ended-banner {
    background: #FFFBEB;
    border: 3px solid #1A1B24;
    border-radius: 16px;
    padding: 12px 20px;
    margin-bottom: 16px;
    box-shadow: 4px 4px 0 #1A1B24;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    font-family: 'Outfit', sans-serif;
}

.sub-ended-text {
    font-size: 0.92rem;
    font-weight: 700;
    color: #92400E;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-renew-sub {
    background: #0A34D3;
    color: #FFFFFF;
    border: 2.5px solid #1A1B24;
    border-radius: 10px;
    padding: 7px 16px;
    font-weight: 800;
    font-size: 0.85rem;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 2px 2px 0 #1A1B24;
    transition: all 0.12s ease-in-out;
    white-space: nowrap;
}

.btn-renew-sub:hover {
    transform: translateY(-2px);
    box-shadow: 4px 4px 0 #1A1B24;
    background: #0624A3;
}

/* --- FULL-PORTION WHITEBOARD DRAWING CANVAS --- */
.figjam-world-whiteboard-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 14000px;
    height: 10000px;
    z-index: 25;
    background: transparent;
    pointer-events: none;
    touch-action: none;
    cursor: default;
}

.figjam-viewport.tool-pencil .figjam-world-whiteboard-canvas,
.figjam-viewport.tool-highlighter .figjam-world-whiteboard-canvas,
.figjam-viewport.tool-eraser .figjam-world-whiteboard-canvas {
    cursor: none !important;
    pointer-events: auto !important;
}

.figjam-viewport.tool-pencil .figjam-pdf-iframe,
.figjam-viewport.tool-highlighter .figjam-pdf-iframe,
.figjam-viewport.tool-eraser .figjam-pdf-iframe {
    pointer-events: none !important;
}

.figjam-viewport.tool-text,
.figjam-viewport.tool-text .figjam-world-whiteboard-canvas {
    cursor: text !important;
}

.figjam-viewport.tool-hand,
.figjam-viewport.tool-hand .figjam-world-whiteboard-canvas {
    cursor: grab !important;
}

.figjam-viewport.tool-select,
.figjam-viewport.tool-select .figjam-world-whiteboard-canvas,
.figjam-viewport.tool-select .figjam-whiteboard-canvas {
    cursor: default !important;
}

/* --- BASE COLLABORATIVE BOARD ELEMENT --- */
.figjam-board-element {
    position: absolute;
    box-sizing: border-box;
    z-index: 15;
    user-select: none;
    transition: box-shadow 0.15s ease, transform 0.1s ease;
}

.figjam-board-element:hover {
    z-index: 35;
}

.figjam-element-del {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid #272727;
    background: #FFFFFF;
    color: #272727;
    font-size: 13px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 0 #272727;
    opacity: 0;
    transition: all 0.15s ease;
    z-index: 20;
    padding: 0;
    line-height: 1;
}

.figjam-board-element:hover .figjam-element-del {
    opacity: 1;
}

.figjam-element-del:hover {
    background: #DC2626;
    color: #FFFFFF;
    border-color: #272727;
    transform: scale(1.18);
}

.figjam-element-resize {
    position: absolute;
    bottom: 4px;
    right: 5px;
    font-size: 13px;
    color: #272727;
    opacity: 0.35;
    cursor: se-resize;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    user-select: none;
    z-index: 10;
    line-height: 1;
}

.figjam-board-element:hover .figjam-element-resize {
    opacity: 0.85;
}

/* --- 1. DIRECT TEXT BLOCK UI --- */
.figjam-text-block {
    min-width: 140px;
    min-height: 38px;
    padding: 6px 12px;
    border: 2px dashed transparent;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(4px);
    cursor: move;
}

.figjam-text-block:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 0 #272727;
}

.figjam-text-block.editing {
    border: 2.5px solid #2563EB;
    box-shadow: 0 4px 0 #272727;
    background: #FFFFFF;
}

.figjam-text-content {
    outline: none;
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #1A1B24;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
    cursor: text;
    user-select: text;
    min-height: 28px;
}

.figjam-text-content:empty:before {
    content: "Type note here...";
    color: #94A3B8;
    pointer-events: none;
}

/* --- 2. UNIVERSAL CARD HEADER & CONTROLS UI --- */
.figjam-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 4px;
    width: 100%;
}

.figjam-card-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    font-family: 'Outfit', sans-serif;
    letter-spacing: 0.5px;
    background: #FEF3C7;
    color: #92400E;
    border: 1.5px solid #272727;
    white-space: nowrap;
}

.figjam-card-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 0.95rem;
    color: #0F172A;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.figjam-card-header .figjam-element-delete {
    background: #F1F5F9;
    border: 1.5px solid #CBD5E1;
    border-radius: 6px;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #64748B;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
    margin-left: auto;
}

.figjam-card-header .figjam-element-delete:hover {
    background: #FEE2E2;
    border-color: #EF4444;
    color: #DC2626;
    transform: scale(1.08);
}

/* --- 3. MATH & FORMULA CARD UI --- */
.figjam-math-card {
    min-width: 290px;
    max-width: 440px;
    width: auto;
    height: auto !important;
    background: #FFFFFF;
    border: 3px solid #272727;
    border-radius: 20px;
    box-shadow: 0 8px 0 #272727, 0 12px 28px rgba(0, 0, 0, 0.08);
    padding: 18px 22px;
    cursor: move;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-sizing: border-box;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.figjam-math-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 0 #272727, 0 16px 32px rgba(0, 0, 0, 0.12);
}

.figjam-math-formula-display,
.figjam-math-formula-box {
    background: #F8FAFC;
    border: 2px solid #272727;
    border-radius: 12px;
    padding: 14px 18px;
    text-align: center;
    font-family: 'Outfit', 'KaTeX_Math', 'Times New Roman', serif;
    font-size: 1.35rem;
    font-weight: 800;
    color: #0F172A;
    margin: 4px 0;
    user-select: text;
    letter-spacing: 0.5px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.03);
    word-break: break-word;
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.figjam-math-notes,
.figjam-diagram-notes,
.figjam-chem-notes,
.figjam-portion-notes,
.figjam-question-notes {
    font-size: 0.88rem;
    line-height: 1.5;
    color: #475569;
    font-family: 'Montserrat', sans-serif;
    outline: none;
    cursor: text;
    user-select: text;
    background: #FFFFFF;
    border: 1.5px dashed #CBD5E1;
    border-radius: 10px;
    padding: 10px 14px;
    min-height: 42px;
    margin-top: 4px;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.figjam-math-notes:focus,
.figjam-diagram-notes:focus,
.figjam-chem-notes:focus,
.figjam-portion-notes:focus,
.figjam-question-notes:focus {
    border-color: #3B82F6;
    background: #F0F9FF;
}

.figjam-math-notes:empty:before,
.figjam-diagram-notes:empty:before,
.figjam-chem-notes:empty:before,
.figjam-portion-notes:empty:before,
.figjam-question-notes:empty:before {
    content: attr(placeholder);
    color: #94A3B8;
    pointer-events: none;
    font-style: italic;
}

/* --- 4. SCIENCE & CIRCUIT DIAGRAM BLOCK UI --- */
.figjam-diagram-card {
    min-width: 290px;
    max-width: 440px;
    width: auto;
    height: auto !important;
    background: #FFFFFF;
    border: 3px solid #272727;
    border-radius: 20px;
    box-shadow: 0 8px 0 #272727, 0 12px 28px rgba(0, 0, 0, 0.08);
    padding: 18px 22px;
    cursor: move;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-sizing: border-box;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.figjam-diagram-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 0 #272727, 0 16px 32px rgba(0, 0, 0, 0.12);
}

.figjam-diagram-svg-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 12px;
    background: #F8FAFC;
    border: 2px solid #272727;
    border-radius: 12px;
    min-height: 140px;
    margin: 4px 0;
}

.figjam-diagram-svg-container svg {
    max-width: 100%;
    height: auto;
}

/* --- 5. CHEMISTRY REACTION BLOCK UI --- */
.figjam-chem-card {
    min-width: 290px;
    max-width: 440px;
    width: auto;
    height: auto !important;
    background: #FFF1F2;
    border: 3px solid #272727;
    border-radius: 20px;
    box-shadow: 0 8px 0 #272727, 0 12px 28px rgba(0, 0, 0, 0.08);
    padding: 18px 22px;
    cursor: move;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-sizing: border-box;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.figjam-chem-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 0 #272727, 0 16px 32px rgba(0, 0, 0, 0.12);
}

.figjam-chem-badge-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.figjam-chem-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #FFE4E6;
    color: #BE123C;
    border: 1.5px solid #272727;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 2px 8px;
    text-transform: uppercase;
    font-family: 'Outfit', sans-serif;
}

.figjam-chem-equation-display,
.figjam-chem-equation {
    background: #FFFFFF;
    border: 2px solid #272727;
    border-radius: 12px;
    padding: 14px 16px;
    text-align: center;
    font-family: 'Outfit', sans-serif;
    font-size: 1.18rem;
    font-weight: 800;
    color: #9F1239;
    margin: 4px 0;
    line-height: 1.45;
}

/* --- 6. CHAPTER TEXTBOOK PORTION CARD UI --- */
.figjam-portion-card {
    min-width: 300px;
    max-width: 460px;
    width: auto;
    height: auto !important;
    background: #F0FDF4;
    border: 3px solid #272727;
    border-radius: 20px;
    box-shadow: 0 8px 0 #272727, 0 12px 28px rgba(0, 0, 0, 0.08);
    padding: 18px 22px;
    cursor: move;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-sizing: border-box;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.figjam-portion-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 0 #272727, 0 16px 32px rgba(0, 0, 0, 0.12);
}

.figjam-portion-quote {
    background: #FFFFFF;
    border-left: 5px solid #16A34A;
    border-top: 2px solid #272727;
    border-right: 2px solid #272727;
    border-bottom: 2px solid #272727;
    border-radius: 12px;
    padding: 14px 18px;
    font-size: 0.92rem;
    line-height: 1.6;
    color: #1F2937;
    font-family: 'Montserrat', sans-serif;
    margin: 4px 0;
    user-select: text;
}

.figjam-portion-page {
    font-size: 0.72rem;
    font-weight: 800;
    background: #DCFCE7;
    color: #15803D;
    border: 1.5px solid #272727;
    border-radius: 6px;
    padding: 2px 6px;
    margin-right: 6px;
}

/* --- 7. STUDY BADGE UI --- */
.figjam-badge-card {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #FEF3C7;
    border: 3px solid #272727;
    border-radius: 24px;
    box-shadow: 0 4px 0 #272727;
    padding: 8px 18px;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 0.92rem;
    color: #1A1B24;
    cursor: move;
}

.figjam-badge-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #272727;
}

/* --- 8. INTERACTIVE IMAGE BOARD ELEMENTS --- */
.figjam-board-image {
    position: absolute;
    border: 2.5px solid transparent;
    border-radius: 12px;
    cursor: move;
    user-select: none;
    box-sizing: border-box;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    background: transparent;
}

.figjam-board-image:hover {
    border-color: #93C5FD;
}

.figjam-board-image.selected {
    border-color: #2563EB;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25), 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 50;
}

.figjam-board-image .figjam-image-inner {
    width: 100%;
    height: 100%;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.figjam-board-image .figjam-image-inner img {
    width: 100%;
    height: 100%;
    object-fit: fill;
    display: block;
    user-select: none;
    pointer-events: none;
}

/* Floating quick action toolbar on top of selected image */
.figjam-image-toolbar {
    position: absolute;
    top: -48px;
    left: 50%;
    transform: translateX(-50%);
    display: none;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: #1E293B;
    border: 2px solid #0F172A;
    border-radius: 12px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
    z-index: 100;
    white-space: nowrap;
}

.figjam-board-image.selected .figjam-image-toolbar {
    display: flex;
}

.figjam-image-tool-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    background: #334155;
    border: 1px solid #475569;
    border-radius: 8px;
    color: #FFFFFF;
    font-size: 12px;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    transition: all 0.12s ease;
}

.figjam-image-tool-btn:hover {
    background: #475569;
    border-color: #64748B;
    transform: translateY(-1px);
}

.figjam-image-tool-btn.btn-delete:hover {
    background: #DC2626;
    border-color: #EF4444;
}

/* Image corner resize handle */
.figjam-image-resize-handle {
    position: absolute;
    bottom: -8px;
    right: -8px;
    width: 16px;
    height: 16px;
    background: #2563EB;
    border: 2.5px solid #FFFFFF;
    border-radius: 50%;
    cursor: nwse-resize;
    display: none;
    z-index: 60;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.figjam-board-image.selected .figjam-image-resize-handle {
    display: block;
}

/* Image Cropper Modal & Dialog */
.figjam-crop-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.figjam-crop-dialog {
    background: #FFFFFF;
    border: 3px solid #1E293B;
    border-radius: 20px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
    width: 90%;
    max-width: 680px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: figjamModalPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.figjam-crop-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 2px solid #E2E8F0;
    background: #F8FAFC;
}

.figjam-crop-title {
    font-size: 1.1rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    color: #0F172A;
    display: flex;
    align-items: center;
    gap: 8px;
}

.figjam-crop-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
    align-items: center;
}

.figjam-crop-viewport {
    position: relative;
    max-width: 100%;
    max-height: 380px;
    border: 2px solid #CBD5E1;
    border-radius: 12px;
    overflow: hidden;
    background: #0F172A;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.figjam-crop-viewport img {
    max-width: 100%;
    max-height: 380px;
    object-fit: contain;
    display: block;
    user-select: none;
    pointer-events: none;
}

.figjam-crop-box {
    position: absolute;
    border: 2px dashed #38BDF8;
    box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.6);
    cursor: move;
    box-sizing: border-box;
}

.figjam-crop-box-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #38BDF8;
    border: 2px solid #FFFFFF;
    border-radius: 2px;
}
.figjam-crop-box-handle.tl { top: -6px; left: -6px; cursor: nwse-resize; }
.figjam-crop-box-handle.tr { top: -6px; right: -6px; cursor: nesw-resize; }
.figjam-crop-box-handle.bl { bottom: -6px; left: -6px; cursor: nesw-resize; }
.figjam-crop-box-handle.br { bottom: -6px; right: -6px; cursor: nwse-resize; }

.figjam-crop-presets {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.figjam-crop-preset-btn {
    padding: 6px 12px;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    background: #F1F5F9;
    font-size: 12px;
    font-weight: 700;
    color: #334155;
    cursor: pointer;
    transition: all 0.12s ease;
}

.figjam-crop-preset-btn:hover,
.figjam-crop-preset-btn.active {
    background: #EFF6FF;
    border-color: #3B82F6;
    color: #1D4ED8;
}

.figjam-crop-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-top: 2px solid #E2E8F0;
    background: #F8FAFC;
}

/* --- DYNAMIC CHAPTER HELPERS PANEL & NEO-BRUTALIST CARDS --- */
.figjam-helpers-pinned-top {
    position: sticky;
    top: -16px;
    background: #FFFFFF;
    z-index: 25;
    margin: -16px -16px 0 -16px;
    padding: 14px 16px 8px 16px;
    border-bottom: 2px solid #E2E8F0;
    box-shadow: 0 4px 12px -4px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}

.figjam-helpers-header-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 12px;
    background: linear-gradient(135deg, #F8FAFC 0%, #EFF6FF 100%);
    border: 2.5px solid #272727;
    border-radius: 14px;
    box-shadow: 0 3px 0 #272727;
    flex-shrink: 0;
}

.figjam-helpers-meta-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.figjam-helpers-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #FEF08A;
    color: #1A1B24;
    border: 2px solid #272727;
    border-radius: 8px;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 2px 8px;
    text-transform: uppercase;
    font-family: 'Outfit', sans-serif;
    box-shadow: 0 2px 0 #272727;
}

.figjam-helpers-live-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.70rem;
    font-weight: 800;
    color: #16A34A;
    background: #DCFCE7;
    border: 1.5px solid #16A34A;
    border-radius: 12px;
    padding: 2px 8px;
    font-family: 'Outfit', sans-serif;
}

.figjam-helpers-live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #16A34A;
    animation: livePulse 1.8s infinite;
}

@keyframes livePulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.4); opacity: 0.6; }
}

.figjam-helpers-chap-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 0.92rem;
    color: #1A1B24;
    line-height: 1.35;
}

/* DYNAMIC TABS STRIP */
.figjam-helpers-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 4px 2px 6px 2px;
    margin-bottom: 0;
    scrollbar-width: thin;
    flex-shrink: 0;
}

.figjam-helpers-tabs::-webkit-scrollbar {
    height: 4px;
}

.figjam-helpers-tabs::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 4px;
}

.figjam-helper-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #FFFFFF;
    border: 2.5px solid #272727;
    border-radius: 12px;
    padding: 6px 12px;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 0.80rem;
    color: #1A1B24;
    box-shadow: 0 3px 0 #272727;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.12s ease;
}

.figjam-helper-tab:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 0 #272727;
    background: #F8FAFC;
}

.figjam-helper-tab.active {
    transform: translateY(1px);
    box-shadow: 0 1px 0 #272727;
    background: #FEF08A;
    border-color: #272727;
}

.figjam-helpers-tab-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding-top: 10px;
}

/* ANIMATED LOADING STATE CARD */
.figjam-helpers-loading-card {
    background: linear-gradient(135deg, #FFFBEB 0%, #FEF3C7 100%);
    border: 3px solid #272727;
    border-radius: 20px;
    box-shadow: 0 6px 0 #272727;
    padding: 24px 18px;
    text-align: center;
    margin: 8px 0;
    position: relative;
    overflow: hidden;
}

.figjam-loading-spark-icon {
    font-size: 2.2rem;
    margin-bottom: 10px;
    display: inline-block;
    animation: floatingSpark 2s ease-in-out infinite alternate;
}

@keyframes floatingSpark {
    0% { transform: translateY(0px) rotate(0deg); }
    100% { transform: translateY(-8px) rotate(10deg); }
}

.figjam-loading-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.05rem;
    color: #1A1B24;
    margin-bottom: 4px;
}

.figjam-loading-subtitle {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.78rem;
    color: #64748B;
    margin-bottom: 14px;
}

.figjam-loading-steps {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
    background: #FFFFFF;
    border: 2px solid #272727;
    border-radius: 12px;
    padding: 10px 14px;
    box-shadow: 0 2px 0 #272727;
}

.figjam-loading-step {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    color: #475569;
}

.figjam-loading-step.active {
    color: #1D4ED8;
    font-weight: 700;
}

/* ITEM ROWS & ACTION BUTTONS */
.figjam-helpers-item-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.figjam-helper-row {
    background: #FFFFFF;
    border: 2.5px solid #272727;
    border-radius: 16px;
    box-shadow: 0 4px 0 #272727;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: all 0.15s ease;
}

.figjam-helper-row:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #272727;
}

.figjam-helper-insert-card-btn {
    background: #3B82F6;
    color: #FFFFFF;
    border: 2px solid #272727;
    border-radius: 10px;
    padding: 4px 10px;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 0.74rem;
    box-shadow: 0 2px 0 #272727;
    cursor: pointer;
    transition: all 0.1s ease;
}

.figjam-helper-insert-card-btn:hover {
    background: #2563EB;
    transform: translateY(-1px);
    box-shadow: 0 3px 0 #272727;
}

.figjam-helper-insert-card-btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 0 #272727;
}

.figjam-helper-insert-text-btn {
    background: #F1F5F9;
    color: #1A1B24;
    border: 2px solid #272727;
    border-radius: 10px;
    padding: 4px 10px;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 0.74rem;
    box-shadow: 0 2px 0 #272727;
    cursor: pointer;
    transition: all 0.1s ease;
}

.figjam-helper-insert-text-btn:hover {
    background: #E2E8F0;
    transform: translateY(-1px);
    box-shadow: 0 3px 0 #272727;
}

.figjam-helper-insert-text-btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 0 #272727;
}

/* QUESTION FILTER CHIPS */
.figjam-question-filters {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 6px;
    margin-bottom: 10px;
}

.figjam-question-filter-chip {
    background: #FFFFFF;
    border: 2px solid #272727;
    border-radius: 10px;
    padding: 4px 10px;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 0.74rem;
    color: #1A1B24;
    box-shadow: 0 2px 0 #272727;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.1s ease;
}

.figjam-question-filter-chip:hover {
    background: #F8FAFC;
    transform: translateY(-1px);
    box-shadow: 0 3px 0 #272727;
}

.figjam-question-filter-chip.active {
    background: #2563EB;
    color: #FFFFFF;
    border-color: #272727;
    transform: translateY(1px);
    box-shadow: 0 1px 0 #272727;
}

/* MITRA VALUES BANNER */
.figjam-mitra-quote-banner {
    background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
    border: 2.5px solid #272727;
    border-radius: 16px;
    box-shadow: 0 4px 0 #272727;
    padding: 12px 14px;
    margin-top: 14px;
}

.figjam-mitra-quote-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 0.80rem;
    color: #1E40AF;
    margin-bottom: 4px;
}

.figjam-mitra-quote-text {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.76rem;
    color: #1E3A8A;
    line-height: 1.45;
    font-style: italic;
    margin: 0;
}

/* THEME & CHARACTER CARDS FOR WHITEBOARD CANVAS */
.figjam-theme-card {
    min-width: 280px;
    max-width: 440px;
    background: linear-gradient(135deg, #F3E8FF 0%, #E9D5FF 100%);
    border: 3px solid #272727;
    border-radius: 20px;
    box-shadow: 0 8px 0 #272727;
    padding: 16px 20px;
    cursor: move;
}

.figjam-theme-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 0 #272727;
}

.figjam-character-card {
    min-width: 280px;
    max-width: 440px;
    background: linear-gradient(135deg, #E0F2FE 0%, #BAE6FD 100%);
    border: 3px solid #272727;
    border-radius: 20px;
    box-shadow: 0 8px 0 #272727;
    padding: 16px 20px;
    cursor: move;
}

.figjam-character-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 0 #272727;
}

.figjam-theme-desc {
    background: #FFFFFF;
    border: 2px solid #272727;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 0.86rem;
    line-height: 1.5;
    color: #334155;
    font-family: 'Montserrat', sans-serif;
    margin-bottom: 8px;
    user-select: text;
}

.figjam-theme-notes {
    font-size: 0.82rem;
    color: #6B21A8;
    font-family: 'Montserrat', sans-serif;
    outline: none;
    cursor: text;
    user-select: text;
    font-style: italic;
}

.figjam-character-role {
    display: inline-block;
    background: #FEF08A;
    border: 1.5px solid #272727;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 2px 6px;
    color: #1A1B24;
    font-family: 'Outfit', sans-serif;
    margin-bottom: 6px;
}

.figjam-character-traits {
    font-size: 0.78rem;
    font-weight: 700;
    color: #0369A1;
    font-family: 'Montserrat', sans-serif;
    margin-bottom: 8px;
}

.figjam-character-notes {
    background: #FFFFFF;
    border: 2px solid #272727;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 0.84rem;
    line-height: 1.5;
    color: #1E293B;
    font-family: 'Montserrat', sans-serif;
    outline: none;
    cursor: text;
    user-select: text;
}

/* --- TOPBAR EXPORT & MORE OPTIONS DROPDOWNS --- */
.figjam-export-wrapper,
.figjam-more-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.btn-topbar-export-main {
    background: #5F5AF6;
    color: #FFFFFF;
    border: 2px solid #1A1B24;
    border-radius: 8px;
    padding: 6px 14px;
    font-weight: 800;
    font-size: 0.88rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Outfit', sans-serif;
    box-shadow: 2px 2px 0 #1A1B24;
    transition: all 0.12s ease;
}

.btn-topbar-export-main:hover {
    background: #4F46E5;
    transform: translateY(-1px);
    box-shadow: 3px 3px 0 #1A1B24;
}

.btn-topbar-export-main:active {
    transform: translateY(1px);
    box-shadow: 1px 1px 0 #1A1B24;
}

.figjam-more-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #FFFFFF;
    border: 3px solid #1A1B24;
    border-radius: 18px;
    box-shadow: 4px 4px 0 #1A1B24;
    padding: 8px;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 350;
    box-sizing: border-box;
}

.figjam-export-dropdown {
    min-width: 200px;
    right: 0;
}

.clear-modal-card {
    background: #FFFFFF;
    border: 3px solid #1A1B24;
    border-radius: 22px;
    box-shadow: 6px 6px 0 #1A1B24;
    animation: clearModalPop 0.18s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes clearModalPop {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.btn-modal-cancel:hover {
    background: #F3F4F6 !important;
    border-color: #9CA3AF !important;
}

.btn-modal-danger:hover {
    background: #DC2626 !important;
    transform: translateY(-1px);
    box-shadow: 3px 3px 0 #1A1B24 !important;
}

.btn-modal-danger:active {
    transform: translateY(1px);
    box-shadow: 1px 1px 0 #1A1B24 !important;
}

.figjam-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    border: none;
    background: transparent;
    border-radius: 10px;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    color: #1A1B24;
    cursor: pointer;
    text-align: left;
    transition: all 0.12s ease;
}

.figjam-dropdown-item:hover {
    background: #F1F5F9;
    transform: translateX(2px);
}

.figjam-dropdown-item.item-danger {
    color: #DC2626;
}

.figjam-dropdown-item.item-danger:hover {
    background: #FEE2E2;
}

.figjam-dropdown-divider {
    height: 2px;
    background: #E2E8F0;
    margin: 4px 0;
}

/* --- KEYBOARD SHORTCUTS & HELP MODAL --- */
.figjam-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 600;
}

.figjam-modal-card {
    background: #FFFFFF;
    border: 3px solid #1A1B24;
    border-radius: 24px;
    box-shadow: 6px 6px 0 #1A1B24;
    width: 90%;
    max-width: 540px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.figjam-modal-header {
    padding: 16px 20px;
    border-bottom: 2.5px solid #1A1B24;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #F8FAFC;
}

.figjam-modal-header h3 {
    margin: 0;
    font-family: 'Outfit', sans-serif;
    font-size: 1.15rem;
    font-weight: 800;
    color: #1A1B24;
}

.figjam-modal-close {
    border: 2px solid #1A1B24;
    background: #FFFFFF;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 8px;
    box-shadow: 2px 2px 0 #1A1B24;
}

.figjam-modal-close:hover {
    background: #F1F5F9;
    transform: translateY(-1px);
}

.figjam-modal-body {
    padding: 20px;
    overflow-y: auto;
}

.shortcuts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.shortcut-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
    font-family: 'Montserrat', sans-serif;
}

.key-badge {
    background: #F1F5F9;
    border: 1.5px solid #1A1B24;
    border-radius: 6px;
    padding: 3px 8px;
    font-family: monospace;
    font-weight: 800;
    font-size: 0.78rem;
    color: #0F172A;
    box-shadow: 0 2px 0 #1A1B24;
    white-space: nowrap;
}

/* --- DIRECT CANVAS TEXT ELEMENT (FIGJAM/MIRO PRODUCTION STANDARD) --- */
.figjam-direct-text {
    position: absolute;
    min-width: 140px;
    min-height: 36px;
    padding: 6px 10px;
    background: transparent !important;
    border: 1.5px solid transparent;
    border-radius: 6px;
    cursor: default;
    z-index: 20;
    box-sizing: border-box;
    transition: border-color 0.15s ease;
    user-select: text;
}

.figjam-direct-text:hover {
    border: 1.5px dashed rgba(37, 99, 235, 0.45) !important;
    background: transparent !important;
}

.figjam-direct-text.selected {
    border: 1.5px solid #2563EB !important;
    background: transparent !important;
    box-shadow: none !important;
}

.figjam-direct-text.editing {
    border: 1.5px solid #3B82F6 !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* Dedicated Top Drag Handle for Effortless Text Relocation */
.figjam-text-drag-handle {
    position: absolute;
    top: -24px;
    left: 0;
    height: 20px;
    padding: 0 6px;
    background: #FFFFFF;
    border: 1.5px solid #1A1B24;
    border-radius: 6px;
    font-size: 13px;
    line-height: 18px;
    color: #1A1B24;
    cursor: grab;
    display: none;
    align-items: center;
    justify-content: center;
    user-select: none;
    box-shadow: 2px 2px 0 rgba(26, 27, 36, 0.2);
    z-index: 40;
    transition: transform 0.1s ease, background-color 0.1s ease;
}

.figjam-text-drag-handle:hover {
    background: #FEF3C7;
    transform: translateY(-1px);
}

.figjam-text-drag-handle:active {
    cursor: grabbing;
}

.figjam-direct-text:hover .figjam-text-drag-handle,
.figjam-direct-text.selected .figjam-text-drag-handle {
    display: flex;
}

.figjam-direct-text .figjam-text-content {
    outline: none;
    min-height: 28px;
    min-width: 100px;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.4;
    cursor: default;
    background: transparent !important;
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    font-style: inherit;
    color: inherit;
    text-align: inherit;
    user-select: none;
}

.figjam-direct-text.editing .figjam-text-content,
.figjam-direct-text .figjam-text-content[contenteditable="true"] {
    cursor: text !important;
    user-select: text !important;
}

.figjam-direct-text .figjam-text-content span,
.figjam-direct-text .figjam-text-content font {
    line-height: inherit;
}

.figjam-direct-text.is-bold,
.figjam-direct-text.is-bold .figjam-text-content {
    font-weight: 800;
}

.figjam-direct-text:not(.is-bold) .figjam-text-content {
    font-weight: 500;
}

.figjam-direct-text.is-italic,
.figjam-direct-text.is-italic .figjam-text-content {
    font-style: italic;
}

.figjam-direct-text .figjam-text-content:empty:before {
    content: attr(placeholder);
    color: #94A3B8;
    pointer-events: none;
    display: inline-block;
}

/* Figma-like Resize Handles for Direct Canvas Text */
.figjam-text-resize-handle {
    position: absolute;
    width: 9px;
    height: 9px;
    background: #FFFFFF;
    border: 2px solid #2563EB;
    border-radius: 2px;
    display: none;
    z-index: 35;
    box-sizing: border-box;
}

.figjam-direct-text.selected .figjam-text-resize-handle {
    display: block;
}

.figjam-text-resize-handle.resize-right {
    top: 50%;
    right: -5px;
    transform: translateY(-50%);
    cursor: ew-resize;
}

.figjam-text-resize-handle.resize-se {
    bottom: -5px;
    right: -5px;
    cursor: nwse-resize;
}

.figjam-text-inline-toolbar {
    display: none !important;
}

.figjam-font-family-select optgroup {
    font-weight: 800;
    color: #0A34D3;
    background: #F8FAFC;
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    padding: 4px 0;
}

.figjam-font-family-select option {
    font-weight: 500;
    color: #1A1B24;
    background: #FFFFFF;
    padding: 6px 10px;
    font-size: 14px;
}

/* Action buttons for Selected Text in Properties Panel */
.figjam-text-actions-row {
    display: flex;
    gap: 8px;
    width: 100%;
}

.figjam-edit-text-btn {
    background: #EEF2FF;
    color: #4338CA;
    border: 2px solid #4338CA;
    border-radius: 10px;
    padding: 10px 14px;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 1;
    box-shadow: 2px 2px 0 #4338CA;
    transition: all 0.15s ease;
}

.figjam-edit-text-btn:hover {
    background: #E0E7FF !important;
    transform: translate(-1px, -1px);
    box-shadow: 3px 3px 0 #4338CA !important;
}

.figjam-edit-text-btn:active {
    transform: translate(1px, 1px);
    box-shadow: 1px 1px 0 #4338CA !important;
}

.figjam-delete-text-btn {
    background: #FEE2E2;
    color: #DC2626;
    border: 2px solid #DC2626;
    border-radius: 10px;
    padding: 10px 14px;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 1;
    box-shadow: 2px 2px 0 #DC2626;
    transition: all 0.15s ease;
}

.figjam-delete-text-btn:hover {
    background: #FECACA !important;
    transform: translate(-1px, -1px);
    box-shadow: 3px 3px 0 #DC2626 !important;
}

.figjam-delete-text-btn:active {
    transform: translate(1px, 1px);
    box-shadow: 1px 1px 0 #DC2626 !important;
}

/* --- DYNAMIC CHAPTER QUESTIONS CARD (NEO-BRUTALISM) --- */
.figjam-question-card {
    position: absolute;
    min-width: 320px;
    max-width: 540px;
    background: #FFE4E6;
    border: 3px solid #272727;
    border-radius: 20px;
    box-shadow: 4px 4px 0 #272727;
    padding: 16px 18px;
    z-index: 20;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
    cursor: move;
}

.figjam-question-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    gap: 8px;
}

.figjam-question-badges {
    display: flex;
    align-items: center;
    gap: 6px;
}

.figjam-question-badge {
    background: #E11D48;
    color: #FFFFFF;
    font-size: 0.72rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    padding: 2px 8px;
    border-radius: 12px;
    border: 2px solid #272727;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.figjam-question-marks {
    background: #FEF08A;
    color: #1A1B24;
    font-size: 0.72rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    padding: 2px 8px;
    border-radius: 12px;
    border: 2px solid #272727;
}

.figjam-question-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.figjam-question-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.05rem;
    font-weight: 800;
    color: #1A1B24;
    margin-bottom: 8px;
    line-height: 1.3;
}

.figjam-question-prompt {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.88rem;
    font-weight: 500;
    line-height: 1.5;
    color: #272727;
    background: rgba(255, 255, 255, 0.7);
    border: 2px solid #272727;
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 12px;
    user-select: text;
    cursor: text;
}

.figjam-question-workspace {
    background: #FFFFFF;
    border: 2px dashed #94A3B8;
    border-radius: 12px;
    padding: 8px 12px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    color: #64748B;
    text-align: center;
}

/* Helper Question Filter Chips */
.figjam-question-filter-chips {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 4px;
    margin-bottom: 12px;
}

.figjam-question-filter-chip {
    background: #FFFFFF;
    color: #1A1B24;
    border: 2px solid #272727;
    border-radius: 12px;
    padding: 3px 9px;
    font-size: 0.72rem;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    transition: all 0.1s ease;
    white-space: nowrap;
}

.figjam-question-filter-chip.active {
    background: #E11D48;
    color: #FFFFFF;
    box-shadow: 2px 2px 0 #272727;
}

/* --- INTERACTIVE GEOMETRIC SHAPES --- */
.figjam-board-shape {
    position: absolute;
    z-index: 12;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-sizing: border-box;
    cursor: move;
    user-select: none;
    transition: box-shadow 0.1s ease;
}

.figjam-board-shape:hover {
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.12));
}

.figjam-board-shape.selected {
    outline: 2.5px solid #4F46E5;
    outline-offset: 3px;
    border-radius: 4px;
}

.figjam-board-shape::before {
    content: '';
    position: absolute;
    top: -44px;
    left: 0;
    right: 0;
    height: 44px;
    pointer-events: auto;
}

.figjam-board-shape .figjam-element-toolbar {
    position: absolute;
    top: -42px;
    left: 50%;
    transform: translateX(-50%);
    display: none;
    align-items: center;
    gap: 4px;
    background: #FFFFFF;
    border: 2px solid #1A1B24;
    border-radius: 8px;
    padding: 3px 6px;
    box-shadow: 2px 2px 0 #1A1B24;
    z-index: 100;
    white-space: nowrap;
}

.figjam-board-shape:hover .figjam-element-toolbar,
.figjam-board-shape.selected .figjam-element-toolbar {
    display: flex !important;
}

.figjam-btn-shape-text {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 12px;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    color: #1A1B24;
    cursor: pointer;
    transition: all 0.12s ease;
}

.figjam-btn-shape-text:hover {
    background: #EEF2FF;
    color: #4F46E5;
    border-color: #C7D2FE;
}

.figjam-shape-resize {
    position: absolute;
    right: -6px;
    bottom: -6px;
    width: 14px;
    height: 14px;
    background: #4F46E5;
    border: 2px solid #FFFFFF;
    border-radius: 4px;
    cursor: nwse-resize;
    z-index: 30;
    display: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.figjam-board-shape.selected .figjam-shape-resize,
.figjam-board-shape:hover .figjam-shape-resize {
    display: block;
}

.figjam-shape-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
    display: block;
    pointer-events: none;
}

.figjam-shape-text {
    position: absolute;
    inset: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    color: #1A1B24;
    outline: none;
    word-break: break-word;
    white-space: pre-wrap;
    overflow: hidden;
    pointer-events: none;
    user-select: none;
    box-sizing: border-box;
    max-height: calc(100% - 24px);
    max-width: calc(100% - 24px);
}

.figjam-shape-text:empty::before {
    content: attr(placeholder);
    color: #94A3B8;
    pointer-events: none;
    font-weight: 500;
    opacity: 0.65;
}

.figjam-board-shape.editing-text .figjam-shape-text {
    pointer-events: auto !important;
    user-select: text !important;
    cursor: text !important;
}

.figjam-board-shape.editing-text {
    cursor: default !important;
}

.figjam-delete-shape-btn {
    width: 100%;
    padding: 10px;
    background: #FFF1F2;
    border: 2px solid #F43F5E;
    border-radius: 10px;
    color: #E11D48;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.12s ease;
    box-shadow: 2px 2px 0 #1A1B24;
}

.figjam-delete-shape-btn:hover {
    background: #E11D48;
    color: #FFFFFF;
    border-color: #1A1B24;
    transform: translateY(-1px);
    box-shadow: 3px 3px 0 #1A1B24;
}

.figjam-edit-shape-text-btn {
    width: 100%;
    padding: 9px;
    background: #EEF2FF;
    border: 2px solid #6366F1;
    border-radius: 10px;
    color: #4F46E5;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.12s ease;
    box-shadow: 2px 2px 0 #1A1B24;
}

.figjam-edit-shape-text-btn:hover {
    background: #4F46E5;
    color: #FFFFFF;
    border-color: #1A1B24;
    transform: translateY(-1px);
    box-shadow: 3px 3px 0 #1A1B24;
}

/* --- TEXT & SHAPE STYLING DRAWER CONTROLS --- */
.figjam-font-family-select {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #1A1B24;
    border-radius: 10px;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    background: #FFFFFF;
    cursor: pointer;
    outline: none;
}

.figjam-text-presets {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.figjam-preset-btn {
    padding: 8px 6px;
    border: 2px solid #1A1B24;
    border-radius: 10px;
    background: #FFFFFF;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 0.75rem;
    cursor: pointer;
    text-align: center;
    transition: all 0.12s ease;
}

.figjam-preset-btn:hover, .figjam-preset-btn.active {
    background: #E0E7FF;
    border-color: #4F46E5;
    color: #4338CA;
}

.figjam-format-toggles {
    display: flex;
    gap: 6px;
}

.figjam-toggle-btn {
    flex: 1;
    padding: 6px 10px;
    border: 2px solid #1A1B24;
    border-radius: 8px;
    background: #FFFFFF;
    font-weight: 800;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.12s ease;
}

.figjam-toggle-btn:hover, .figjam-toggle-btn.active {
    background: #E0E7FF;
    border-color: #4F46E5;
    color: #4338CA;
}

.figjam-shapes-palette {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.figjam-shape-select-btn {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px solid #1A1B24;
    border-radius: 12px;
    background: #FFFFFF;
    cursor: pointer;
    font-size: 1.3rem;
    transition: all 0.12s ease;
}

.figjam-shape-select-btn:hover, .figjam-shape-select-btn.active {
    background: #FEF08A;
    transform: translateY(-2px);
    box-shadow: 0 3px 0 #1A1B24;
}

.figjam-shape-select-btn span.label {
    font-size: 0.62rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    margin-top: 2px;
}

/* --- CANVAS ZOOM HUD NEO-BRUTALISM OVERRIDE --- */
.canvas-zoom-hud {
    position: absolute;
    top: 16px;
    left: 16px;
    bottom: auto;
    right: auto;
    background: rgba(255, 255, 255, 0.95);
    border: 2.5px solid #1A1B24;
    border-radius: 14px;
    padding: 4px 6px;
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: 4px 4px 0 #1A1B24;
    z-index: 100;
}

.zoom-btn {
    width: 30px;
    height: 30px;
    border: 2px solid transparent;
    background: transparent;
    border-radius: 8px;
    font-weight: 900;
    font-size: 1rem;
    color: #1A1B24;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.1s ease;
}

.zoom-btn:hover {
    background: #F1F5F9;
    border-color: #1A1B24;
}

.zoom-text {
    font-size: 0.85rem;
    font-weight: 900;
    font-family: 'Outfit', sans-serif;
    padding: 0 6px;
    min-width: 52px;
    text-align: center;
    color: #1A1B24;
    cursor: pointer;
}

.zoom-text:hover {
    color: #4F46E5;
}

/* ==========================================================================
   MITRA AI LEARNING COMPANION (STUDENT POV)
   ========================================================================== */


/* Bottom Floating Pill Toolbar: Mitra AI Tool Item */
.figjam-pill-item[data-tool="mitra"].active {
    background: #EEF2FF;
    border-color: #6366F1;
    color: #4F46E5;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

.figjam-pill-item[data-tool="mitra"]:hover {
    background: #F5F3FF;
}

/* Mitra AI Companion Drawer Container (Paathshala brand theme: clean, crisp, friendly) */
.figjam-assets-panel.mitra-mode {
    background: #FFFFFF;
    color: #1A1B24;
    border-left: 2.5px solid #1A1B24;
    width: 370px;
    box-shadow: -6px 0 24px rgba(26, 27, 36, 0.08);
}

.figjam-assets-panel.mitra-mode .figjam-assets-header {
    background: #F8FAFC;
    border-bottom: 2px solid #1A1B24;
    color: #1A1B24;
    padding: 12px 16px;
}

.figjam-assets-panel.mitra-mode .figjam-assets-header h3 {
    color: #1A1B24;
    font-size: 0.95rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.figjam-assets-panel.mitra-mode .figjam-assets-close {
    background: #FFFFFF;
    color: #1A1B24;
    border: 1.5px solid #1A1B24;
    border-radius: 6px;
    width: 26px;
    height: 26px;
    font-weight: 800;
    transition: all 0.15s ease;
}

.figjam-assets-panel.mitra-mode .figjam-assets-close:hover {
    background: #FEE2E2;
    color: #DC2626;
    border-color: #DC2626;
}

.figjam-assets-panel.mitra-mode .figjam-assets-body {
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.mitra-drawer-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    overflow: hidden;
    background: #F8FAFC;
    color: #1A1B24;
    justify-content: space-between;
}

.mitra-main-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 14px 14px 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    scrollbar-width: thin;
    scrollbar-color: #CBD5E1 transparent;
}

/* Header Elements */
.mitra-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding-right: 4px;
}

.mitra-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mitra-brand-sparkle {
    color: #5F5AF6;
    font-size: 1.15rem;
    line-height: 1;
}

.mitra-header-title {
    font-size: 0.92rem;
    font-weight: 800;
    color: #1A1B24;
    font-family: 'Outfit', sans-serif;
}

.mitra-sync-pill-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #FFFFFF;
    border: 1.5px solid #1A1B24;
    color: #1A1B24;
    border-radius: 8px;
    padding: 3px 9px;
    font-size: 0.74rem;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    transition: all 0.15s ease;
}

.mitra-sync-pill-btn:hover {
    background: #EEF2FF;
    border-color: #5F5AF6;
    color: #4F46E5;
}

/* --- EMPTY VIEW (Paathshala Brand Alignment) --- */
.mitra-gemini-empty-wrap {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* User query bubble: right-aligned pill in soft Paathshala purple */
.mitra-user-query-row {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 4px;
}

.mitra-user-query-pill {
    background: #EEF2FF;
    color: #3730A3;
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 18px;
    max-width: 90%;
    line-height: 1.4;
    border: 1.5px solid #C7D2FE;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.08);
}

/* Empty response card */
.mitra-empty-response-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #FFFFFF;
    border: 1.5px solid #E2E8F0;
    border-radius: 14px;
    padding: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.mitra-sparkle-icon {
    font-size: 1.25rem;
    color: #5F5AF6;
    line-height: 1;
    display: flex;
    align-items: center;
}

.mitra-empty-response-text {
    font-size: 0.88rem;
    line-height: 1.55;
    color: #334155;
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
}

.mitra-empty-actions-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    padding-top: 10px;
    border-top: 1px solid #F1F5F9;
}

.mitra-action-pill-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #F8FAFC;
    border: 1.5px solid #E2E8F0;
    color: #475569;
    border-radius: 8px;
    padding: 4px 10px;
    font-size: 0.76rem;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    transition: all 0.15s ease;
}

.mitra-action-pill-btn:hover {
    background: #EEF2FF;
    color: #4F46E5;
    border-color: #C7D2FE;
}

.mitra-actions-spacer {
    flex: 1;
}

.mitra-icon-btn {
    background: #F8FAFC;
    border: 1.5px solid #E2E8F0;
    color: #64748B;
    cursor: pointer;
    padding: 5px 7px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.mitra-icon-btn:hover {
    color: #4F46E5;
    background: #EEF2FF;
    border-color: #C7D2FE;
}

.mitra-icon-btn.active {
    color: #5F5AF6;
    background: #EEF2FF;
    border-color: #5F5AF6;
}

/* CTA Suggestions list with curved arrow ↳ */
.mitra-cta-suggestions-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}

.mitra-cta-suggestion-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #FFFFFF;
    border: 1.5px solid #E2E8F0;
    padding: 10px 12px;
    border-radius: 12px;
    cursor: pointer;
    color: #1E293B;
    font-family: 'Outfit', sans-serif;
    font-size: 0.84rem;
    font-weight: 600;
    text-align: left;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    width: 100%;
}

.mitra-cta-suggestion-item:hover {
    background: #F5F3FF;
    border-color: #C7D2FE;
    color: #4338CA;
    transform: translateX(2px);
    box-shadow: 0 3px 10px rgba(99, 102, 241, 0.1);
}

.mitra-cta-arrow {
    font-size: 1.15rem;
    line-height: 1;
    color: #5F5AF6;
    font-weight: 800;
}

.mitra-cta-suggestion-item:hover .mitra-cta-arrow {
    color: #4338CA;
}

.mitra-cta-text {
    flex: 1;
}

/* Daily Navigation Bar */
.mitra-daily-timeline-bar {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 6px 8px;
    background: #FFFFFF;
    border: 1.5px solid #E2E8F0;
    border-radius: 12px;
    scrollbar-width: thin;
}

.mitra-daily-date-pill {
    background: #F8FAFC;
    border: 1px solid #CBD5E1;
    color: #475569;
    font-size: 0.76rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 10px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
    font-family: 'Outfit', sans-serif;
}

.mitra-daily-date-pill:hover {
    background: #EEF2FF;
    border-color: #C7D2FE;
    color: #4F46E5;
}

.mitra-daily-date-pill.active {
    background: #5F5AF6;
    border-color: #4F46E5;
    color: #FFFFFF;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(95, 90, 246, 0.25);
}

/* --- DOCKED BOTTOM ASK MITRA INPUT CARD (Brand alignment) --- */
.mitra-bottom-ask-container {
    padding: 10px 14px 12px 14px;
    background: #FFFFFF;
    border-top: 1.5px solid #E2E8F0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
}

.mitra-ask-card {
    background: #F8FAFC;
    border: 1.5px solid #CBD5E1;
    border-radius: 16px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.mitra-ask-card:focus-within {
    background: #FFFFFF;
    border-color: #5F5AF6;
    box-shadow: 0 4px 16px rgba(95, 90, 246, 0.15);
}

.mitra-ask-textarea {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    color: #1A1B24;
    font-family: 'Outfit', sans-serif;
    font-size: 0.88rem;
    font-weight: 500;
    resize: none;
    min-height: 24px;
    max-height: 90px;
    line-height: 1.45;
}

.mitra-ask-textarea::placeholder {
    color: #94A3B8;
}

.mitra-ask-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 2px;
}

.mitra-ask-sparkle {
    color: #5F5AF6;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mitra-ask-btn-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.mitra-ask-options-btn {
    background: transparent;
    border: none;
    color: #64748B;
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.mitra-ask-options-btn:hover {
    background: #EEF2FF;
    color: #4F46E5;
}

.mitra-ask-send-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #E2E8F0;
    color: #94A3B8;
    border: none;
    cursor: not-allowed;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.mitra-ask-send-btn.active {
    background: #5F5AF6;
    color: #FFFFFF;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(95, 90, 246, 0.35);
}

.mitra-ask-send-btn.active:hover {
    background: #4338CA;
    transform: scale(1.06);
}

.mitra-ask-disclaimer {
    font-size: 0.72rem;
    color: #94A3B8;
    text-align: center;
    font-family: 'Outfit', sans-serif;
    line-height: 1.3;
}

.mitra-ask-disclaimer a {
    color: #5F5AF6;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
}

.mitra-ask-disclaimer a:hover {
    text-decoration: underline;
    color: #4338CA;
}

/* Quick popup options menu */
.mitra-options-popup {
    position: absolute;
    bottom: 74px;
    right: 18px;
    background: #FFFFFF;
    border: 1.5px solid #CBD5E1;
    border-radius: 12px;
    padding: 6px 0;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
    z-index: 300;
    min-width: 200px;
    display: flex;
    flex-direction: column;
}

.mitra-options-item {
    background: transparent;
    border: none;
    padding: 8px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #334155;
    text-align: left;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    transition: background 0.15s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mitra-options-item:hover {
    background: #EEF2FF;
    color: #4F46E5;
}

/* Notes Content Box inside Light Brand Drawer */
.mitra-drawer-container .mitra-status-badge {
    background: #ECFDF5;
    border: 1px solid #A7F3D0;
    color: #065F46;
    font-size: 0.76rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mitra-drawer-container .mitra-sec-header {
    color: #5F5AF6;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    font-family: 'Outfit', sans-serif;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

.mitra-drawer-container .mitra-digest-box {
    background: #FFFFFF;
    border: 1.5px solid #E2E8F0;
    border-radius: 12px;
    padding: 12px 14px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.mitra-drawer-container .mitra-digest-title {
    color: #5F5AF6;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    font-family: 'Outfit', sans-serif;
}

.mitra-drawer-container .mitra-digest-sub {
    color: #64748B;
    font-size: 0.76rem;
    font-weight: 600;
}

.mitra-drawer-container .mitra-digest-list {
    margin: 8px 0 0 0;
    padding-left: 18px;
    font-size: 0.84rem;
    color: #334155;
    line-height: 1.6;
    font-family: 'Outfit', sans-serif;
}

.mitra-drawer-container .mitra-digest-list li {
    margin-bottom: 4px;
}

.mitra-drawer-container .mitra-digest-eq {
    margin-top: 8px;
    background: #EEF2FF;
    border: 1.5px dashed #A5B4FC;
    border-radius: 8px;
    padding: 6px 10px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-weight: 700;
    font-size: 0.85rem;
    color: #3730A3;
    text-align: center;
}

.mitra-drawer-container .mitra-concepts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.mitra-drawer-container .mitra-concept-card {
    background: #FFFBEB;
    border: 1.5px solid #FDE68A;
    border-radius: 10px;
    padding: 10px 12px;
}

.mitra-drawer-container .mitra-concept-name {
    color: #78350F;
    font-weight: 800;
    font-size: 0.82rem;
    font-family: 'Outfit', sans-serif;
}

.mitra-drawer-container .mitra-concept-desc {
    color: #92400E;
    font-size: 0.78rem;
    margin-top: 4px;
    line-height: 1.45;
}

.mitra-drawer-container .mitra-doubts-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mitra-drawer-container .mitra-doubt-card {
    background: #FAF5FF;
    border: 1.5px solid #E9D5FF;
    border-radius: 10px;
    padding: 10px 12px;
}

.mitra-drawer-container .mitra-doubt-q {
    color: #581C87;
    font-weight: 700;
    font-size: 0.82rem;
    font-family: 'Outfit', sans-serif;
}

.mitra-drawer-container .mitra-doubt-a {
    color: #6B21A8;
    font-size: 0.78rem;
    margin-top: 4px;
    line-height: 1.45;
}

.mitra-drawer-container .mitra-checklist {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mitra-drawer-container .mitra-check-item {
    background: #FFFFFF;
    border: 1.5px solid #DCFCE7;
    color: #166534;
    border-radius: 8px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.mitra-drawer-container .mitra-check-item:hover {
    border-color: #86EFAC;
    background: #F0FDF4;
}

.mitra-drawer-container .mitra-check-box {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 1.5px solid #16A34A;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #FFFFFF;
    background: transparent;
    flex-shrink: 0;
}

.mitra-drawer-container .mitra-check-item.checked .mitra-check-box {
    background: #16A34A;
}

.mitra-drawer-container .mitra-check-item.checked .mitra-check-label {
    text-decoration: line-through;
    color: #94A3B8;
}

.mitra-drawer-container .mitra-check-label {
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.4;
    font-family: 'Outfit', sans-serif;
}

.mitra-stamp-btn {
    background: #EEF2FF;
    color: #4F46E5;
    border: 1.5px solid #C7D2FE;
    border-radius: 6px;
    font-weight: 700;
    font-size: 11px;
    padding: 4px 10px;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-top: 8px;
    font-family: 'Outfit', sans-serif;
}

.mitra-stamp-btn:hover {
    background: #4F46E5;
    color: #FFFFFF;
    border-color: #4338CA;
}

/* Whiteboard Canvas Element: Pinned Mitra Summary Card */
.figjam-mitra-card {
    width: 360px;
    min-height: 240px;
    background: #FAF5FF;
    border: 2.5px solid #1A1B24;
    border-radius: 16px;
    box-shadow: 5px 5px 0 #1A1B24;
    overflow: hidden;
    position: absolute;
    z-index: 100;
    cursor: move;
    user-select: none;
    display: flex;
    flex-direction: column;
}

.figjam-mitra-card-header {
    background: #4F46E5;
    color: #FFFFFF;
    padding: 10px 14px;
    border-bottom: 2px solid #1A1B24;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.figjam-mitra-card-title-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}

.figjam-mitra-card-pin {
    font-size: 14px;
}

.figjam-mitra-card-title {
    font-size: 0.85rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    color: #FFFFFF;
}

.figjam-mitra-card-body {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    cursor: default;
}

.figjam-mitra-card-sec-title {
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6B21A8;
}

.figjam-mitra-card-bullets {
    margin: 0 0 4px 18px;
    padding: 0;
    font-size: 0.82rem;
    color: #1E293B;
    line-height: 1.5;
    outline: none;
}

.figjam-mitra-card-notes {
    background: #FFFFFF;
    border: 1.5px solid #1A1B24;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 0.8rem;
    color: #334155;
    line-height: 1.45;
    min-height: 48px;
    outline: none;
}

.figjam-mitra-card-notes:focus,
.figjam-mitra-card-bullets:focus {
    border-color: #6366F1;
    background: #FFFFFF;
}

/* --- MITRA COMPANION SKELETON, ERROR & INTERACTION STYLES --- */
@keyframes mitraShimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.mitra-skeleton-wrap {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 6px 0;
}

.mitra-skeleton-card {
    background: linear-gradient(90deg, #F8FAFC 25%, #E2E8F0 50%, #F8FAFC 75%);
    background-size: 200% 100%;
    animation: mitraShimmer 1.5s infinite ease-in-out;
    border: 2px solid #E2E8F0;
    border-radius: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mitra-skeleton-line {
    height: 12px;
    background: linear-gradient(90deg, #E2E8F0 25%, #CBD5E1 50%, #E2E8F0 75%);
    background-size: 200% 100%;
    animation: mitraShimmer 1.5s infinite ease-in-out;
    border-radius: 6px;
}

.mitra-skeleton-line.short {
    width: 45%;
}

.mitra-skeleton-line.medium {
    width: 70%;
}

.mitra-skeleton-line.full {
    width: 100%;
}

.mitra-error-state {
    background: #FEF2F2;
    border: 2.5px solid #EF4444;
    border-radius: 18px;
    padding: 22px 18px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin: 12px 0;
    box-shadow: 0 4px 0 rgba(239, 68, 68, 0.2);
}

.mitra-error-icon {
    font-size: 2.2rem;
    line-height: 1;
}

.mitra-error-title {
    font-weight: 800;
    font-size: 0.95rem;
    color: #991B1B;
    font-family: 'Outfit', sans-serif;
}

.mitra-error-desc {
    font-size: 0.8rem;
    color: #B91C1C;
    line-height: 1.45;
}

.mitra-retry-btn {
    background: #EF4444;
    color: #FFFFFF;
    border: 2px solid #991B1B;
    border-radius: 12px;
    padding: 8px 18px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 3px 0 #991B1B;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.mitra-retry-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 0 #991B1B;
}

.mitra-retry-btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 0 #991B1B;
}

.mitra-refresh-btn {
    background: #F3E8FF;
    border: 1.5px solid #8B5CF6;
    color: #6D28D9;
    border-radius: 8px;
    padding: 4px 10px;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: background 0.15s, transform 0.15s;
    float: right;
}

.mitra-refresh-btn:hover {
    background: #E9D5FF;
    transform: translateY(-1px);
}

.figjam-direct-text .figjam-element-delete {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 22px;
    height: 22px;
    background: #EF4444;
    color: #FFFFFF;
    border: 1.5px solid #1A1B24;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 2px 0 #1A1B24;
}

.figjam-direct-text:hover .figjam-element-delete,
.figjam-direct-text.figjam-element-selected .figjam-element-delete {
    display: flex;
}

.figjam-board-element.figjam-element-selected,
.figjam-sticky-note.figjam-element-selected {
    outline: 2px dashed #6366F1 !important;
    outline-offset: 3px !important;
}
