/* ==========================================================================
   AMBA AI - ADVANCED SAAS FRAMEWORK THEME (TAILWIND / BOOTSTRAP MODERN DESIGN)
   Premium Modern Typography, Slate Aesthetic, Smooth Elevations & Crisp Accents
   ========================================================================== */

:root {
    /* Premium Modern Framework Typography System */
    --font-sans: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-heading: 'Outfit', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

    /* Advanced Framework Dark Palette (Tailwind Slate / Modern Cloud Console) */
    --bg-main: #0b0f19;              /* Deep canvas background */
    --bg-secondary: #111827;         /* Cards, Sidebar & Topbars */
    --bg-tertiary: #1f2937;          /* Toolbars, Elevated surfaces, Active rows */
    --bg-input: #0f172a;             /* Textarea, Console & Inputs */
    --border-subtle: rgba(255, 255, 255, 0.08); /* Clean modern hairline borders */
    --border-focus: #38bdf8;         /* Tailwind Sky / Cyan accent */

    /* Advanced Framework Syntax & Semantic Accents */
    --npp-keyword: #38bdf8;          /* Sky Blue (Tailwind 400) */
    --npp-string: #fca5a5;           /* Soft Coral / Salmon */
    --npp-comment: #34d399;          /* Emerald Green (Tailwind 400) */
    --npp-number: #c084fc;           /* Lavender / Violet */
    --npp-function: #fbbf24;         /* Amber Yellow */
    --npp-type: #2dd4bf;             /* Teal */
    --npp-accent: #2563eb;           /* Modern Royal Blue */
    --npp-warn: #f59e0b;            /* Warning Amber */
    --npp-error: #f87171;           /* Error Rose */

    /* Typography Colors */
    --text-primary: #f8fafc;         /* Slate 50 crisp foreground text */
    --text-secondary: #94a3b8;       /* Slate 400 identifier */
    --text-muted: #64748b;           /* Slate 500 secondary / gutter */

    /* Premium Modern Framework Radii & Shadows */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-full: 9999px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.25);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.2);
    --focus-ring: 0 0 0 2px rgba(56, 189, 248, 0.35);
}

/* Global Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 13.5px;
    line-height: 1.55;
    letter-spacing: -0.01em;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* App Master Layout */
.app-layout {
    display: flex;
    width: 100vw;
    height: 100vh;
    position: relative;
    background: var(--bg-main);
    overflow: hidden;
}

/* ==========================================================================
   LEFT SIDEBAR (NOTEPAD++ DOCUMENT TREE STYLE)
   ========================================================================== */
.sidebar {
    width: 250px;
    min-width: 250px;
    max-width: 250px;
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 8px;
    flex-shrink: 0;
    z-index: 100;
}

.sidebar.collapsed {
    margin-left: -250px;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 8px;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand-avatar-mini {
    position: relative;
    width: 24px;
    height: 24px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

.brand-avatar-mini img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.status-pulse-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 6px;
    height: 6px;
    background-color: var(--npp-comment);
    border-radius: 1px;
}

.brand-info h2 {
    font-family: var(--font-heading);
    font-size: 0.98rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #f8fafc;
}

.brand-subtitle {
    font-family: var(--font-sans);
    font-size: 0.7rem;
    color: #38bdf8;
    font-weight: 500;
    display: block;
}

/* New Chat Button */
.new-chat-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 7px 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 8px;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.new-chat-btn:hover {
    background: #1e293b;
    border-color: var(--border-focus);
    color: #fff;
    box-shadow: var(--shadow-sm);
}

.new-chat-btn i {
    color: var(--npp-keyword);
}

.kbd-badge {
    background: var(--bg-main);
    font-family: var(--font-mono);
    font-size: 0.65rem;
    padding: 2px 5px;
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    color: var(--text-muted);
}

/* History */
.sidebar-section-title {
    font-family: var(--font-sans);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    font-weight: 700;
    margin: 8px 0 5px 2px;
}

.chat-history-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s ease;
}

.history-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-subtle);
}

.history-item.active {
    background: rgba(56, 189, 248, 0.14);
    border-color: rgba(56, 189, 248, 0.45);
    color: #38bdf8;
    font-weight: 600;
}

/* Sidebar Footer */
.sidebar-footer {
    border-top: 1px solid var(--border-subtle);
    padding-top: 6px;
    margin-top: auto;
}

.amba-status-card {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-avatar {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    flex-shrink: 0;
    position: relative;
}

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

.online-indicator {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 6px;
    height: 6px;
    background-color: var(--npp-comment);
}

.status-details {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.status-name {
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--npp-keyword);
}

.status-state {
    font-size: 0.65rem;
    color: var(--npp-comment);
}

/* ==========================================================================
   MAIN CHAT CONTAINER (NOTEPAD++ EDITOR PANE)
   ========================================================================== */
.chat-container {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: var(--bg-main);
    position: relative;
    overflow: hidden;
}

/* Topbar */
.chat-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 3px 12px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-subtle);
    height: 38px;
    flex-shrink: 0;
}

.topbar-left,
.topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.topbar-avatar {
    width: 22px;
    height: 22px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

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

.persona-badge {
    display: flex;
    align-items: center;
    gap: 6px;
}

.persona-title {
    font-family: var(--font-heading);
    font-weight: 700;
    color: #38bdf8;
    font-size: 0.88rem;
    letter-spacing: -0.01em;
}

.badge-role {
    font-family: var(--font-sans);
    font-size: 0.72rem;
    color: #34d399;
    font-weight: 500;
}

.icon-btn {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.82rem;
    transition: all 0.15s ease;
}

.icon-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-subtle);
    color: var(--text-primary);
}

.curriculum-toggle-btn {
    width: auto !important;
    min-width: 32px;
    height: 28px;
    padding: 0 10px;
    gap: 6px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.76rem;
    cursor: pointer;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    white-space: nowrap;
    transition: all 0.15s ease;
    font-family: var(--font-sans);
}

.curriculum-toggle-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-focus);
}

.curriculum-toggle-btn.active {
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.6);
    background: rgba(56, 189, 248, 0.15);
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.25);
}

.curriculum-toggle-label {
    font-size: 0.74rem;
    font-family: var(--font-sans);
    font-weight: 600;
}

/* Auto-speak toggle */
.auto-speak-container {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-sans);
    font-size: 0.74rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.switch {
    position: relative;
    display: inline-block;
    width: 30px;
    height: 16px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    transition: 0.2s ease;
}

.slider:before {
    position: absolute;
    content: "";
    height: 12px;
    width: 12px;
    left: 1px;
    bottom: 1px;
    background-color: var(--text-muted);
    border-radius: 50%;
    transition: 0.2s ease;
}

input:checked + .slider {
    background-color: #0284c7;
    border-color: #38bdf8;
}

input:checked + .slider:before {
    transform: translateX(14px);
    background-color: #fff;
}

/* ==========================================================================
   AMBA AUDIO DOCK (ADVANCED SAAS TELEMETRY BAR)
   ========================================================================== */
.amba-player-dock {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 3px 14px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-subtle);
    font-family: var(--font-sans);
    font-size: 0.74rem;
    height: 34px;
    flex-shrink: 0;
}

.player-left {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--npp-comment);
}

.speaker-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    background: var(--npp-comment);
    border-radius: 50%;
}

.wave-bar { display: none; }

.player-label {
    font-family: var(--font-heading);
    font-weight: 700;
    color: #38bdf8;
}

.player-sub {
    font-family: var(--font-sans);
    color: var(--text-muted);
}

.player-center {
    display: flex;
    align-items: center;
    gap: 10px;
}

.player-buttons {
    display: flex;
    gap: 5px;
}

.player-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.72rem;
    font-family: var(--font-sans);
    font-weight: 500;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.player-btn:hover {
    background: #1e293b;
    border-color: var(--border-focus);
    color: #fff;
}

.player-timeline {
    display: flex;
    align-items: center;
    gap: 6px;
}

.time-counter {
    font-size: 0.7rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
}

.time-progress-track {
    width: 90px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.time-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #38bdf8, #2563eb);
    border-radius: var(--radius-full);
    width: 0%;
    transition: width 0.1s linear;
}

.player-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-start-lab {
    background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
    border: none;
    color: #fff;
    padding: 3px 10px;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 0.74rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(2, 132, 199, 0.25);
    transition: all 0.15s ease;
}
.btn-start-lab:hover {
    filter: brightness(1.1);
    transform: translateY(-0.5px);
}

.session-timer-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, 0.35);
    background: rgba(52, 211, 153, 0.1);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 600;
}

.btn-extend-inline {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    color: var(--npp-comment);
    padding: 0 4px;
    border-radius: 1px;
    font-size: 0.65rem;
    cursor: pointer;
}

/* ==========================================================================
   MESSAGES SCROLL AREA
   ========================================================================== */
.messages-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 10px 20px 20px;
    background: var(--bg-main);
    width: 100%;
}

.welcome-hero {
    width: 100%;
    max-width: 100%;
    margin: 16px 0 24px;
    padding: 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    text-align: center;
    font-family: var(--font-sans);
    box-shadow: var(--shadow-sm);
}

.hero-avatar-wrap {
    width: 44px;
    height: 44px;
    margin: 0 auto 10px;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-sm);
}

.hero-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.glowing-ring { display: none; }

.hero-title {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #f8fafc;
    margin-bottom: 6px;
}

.hero-subtitle {
    font-family: var(--font-sans);
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.55;
    margin-bottom: 14px;
    max-width: 680px;
    margin-left: auto;
    margin-right: auto;
}

.hero-chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.quick-prompt-btn {
    background: var(--bg-tertiary) !important;
    border: 1px solid var(--border-subtle) !important;
    border-radius: var(--radius-full) !important;
    color: var(--text-primary) !important;
    font-family: var(--font-sans) !important;
    font-size: 0.74rem !important;
    font-weight: 500 !important;
    padding: 4px 12px !important;
    cursor: pointer;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1) !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
}
.quick-prompt-btn:hover {
    background: #1e293b !important;
    border-color: var(--border-focus) !important;
    color: #38bdf8 !important;
    transform: translateY(-0.5px);
    box-shadow: var(--shadow-sm);
}

.messages-list {
    width: 100%;
    max-width: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message-row {
    display: flex;
    gap: 10px;
    width: 100%;
}

.message-row.user {
    justify-content: flex-end;
}

.message-avatar {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    flex-shrink: 0;
    margin-top: 2px;
}

.message-avatar img,
.user-avatar-icon {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    object-fit: cover;
    background: var(--bg-tertiary);
    color: #38bdf8;
    font-size: 0.74rem;
}

.message-content-box {
    width: 100%;
    max-width: 98%;
}

.message-row.user .message-content-box {
    max-width: 86%;
}

.amba-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    font-family: var(--font-sans);
}

.amba-name {
    font-family: var(--font-heading);
    font-size: 0.84rem;
    font-weight: 700;
    color: #38bdf8;
    letter-spacing: -0.01em;
}

.message-time {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-weight: 500;
}

.message-bubble {
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 0.88rem;
    line-height: 1.6;
    word-break: break-word;
}

.message-row.user .message-bubble {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #f8fafc;
    box-shadow: var(--shadow-sm);
}

.message-row.amba .message-bubble {
    background: #111827;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-left: 3px solid var(--border-focus);
    color: #f1f5f9;
    box-shadow: var(--shadow-sm);
}

/* Markdown styling inside bubbles */
.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4 {
    font-family: var(--font-heading);
    color: var(--npp-function);
    margin: 12px 0 6px 0;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.markdown-body h1 { font-size: 1.15rem; border-bottom: 1px solid var(--border-subtle); padding-bottom: 4px; }
.markdown-body h2 { font-size: 1.02rem; }
.markdown-body h3 { font-size: 0.92rem; color: #38bdf8; }
.markdown-body h4 { font-size: 0.86rem; color: #2dd4bf; }

.markdown-body p { margin: 6px 0; line-height: 1.6; }
.markdown-body ul, .markdown-body ol { margin: 6px 0 6px 20px; }
.markdown-body li { margin: 3px 0; line-height: 1.55; }

.markdown-body blockquote {
    border-left: 3px solid #38bdf8;
    padding: 6px 12px;
    margin: 8px 0;
    background: rgba(56, 189, 248, 0.08);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 0.84rem;
}

/* Realtime Typing Indicator & Blinking Cursor */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    margin: 10px 0 0;
    padding: 4px 0;
}

.typing-avatar {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid var(--border-subtle);
}

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

.typing-bubble {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-left: 3px solid var(--border-focus);
    padding: 8px 14px;
    border-radius: var(--radius-md);
    font-size: 0.82rem;
    color: #38bdf8;
    font-family: var(--font-sans);
    box-shadow: var(--shadow-sm);
}

.typing-dots {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}

.typing-dots .dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--npp-keyword);
    animation: typingPulse 1.2s infinite ease-in-out;
}

.typing-dots .dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dots .dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingPulse {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-4px); opacity: 1; }
}

.typing-cursor {
    display: inline-block;
    width: 3px;
    height: 1.15em;
    background: #ff9900;
    box-shadow: 0 0 8px rgba(255, 153, 0, 0.85);
    margin-left: 3px;
    vertical-align: -0.15em;
    border-radius: 1px;
    animation: cursorBlink 0.7s infinite ease-in-out;
}

@keyframes cursorBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.code-block-container {
    margin: 6px 0;
    background: var(--bg-main);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2px 8px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.7rem;
    color: var(--text-muted);
}

.console-label { color: var(--npp-keyword); font-weight: 600; }

.copy-code-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.68rem;
    font-family: var(--font-mono);
}
.copy-code-btn:hover { color: #fff; }

pre {
    margin: 0;
    padding: 6px 8px;
    background: var(--bg-main);
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

code {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--npp-string);
}

p code, li code {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    padding: 1px 4px;
    border-radius: 2px;
    color: var(--npp-keyword);
}

/* ==========================================================================
   AMBA INTERACTIVE SUBTITLE & TELEPROMPTER DOCK
   ========================================================================== */
.amba-subtitle-dock {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 18px;
    background: linear-gradient(180deg, #1f2024 0%, #17181c 100%);
    border-top: 1px solid rgba(56, 189, 248, 0.35);
    border-bottom: 1px solid var(--border-subtle);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
    position: relative;
    z-index: 40;
}

.subtitle-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.subtitle-label-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.subtitle-live-badge {
    font-size: 0.7rem;
    font-weight: 700;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.35);
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.02em;
    font-family: var(--font-heading);
}

.subtitle-section-pill {
    font-size: 0.74rem;
    font-weight: 600;
    color: #94a3b8;
    font-family: var(--font-sans);
    max-width: 420px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.subtitle-ctrls {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

.subtitle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 5px 12px;
    font-size: 0.74rem;
    font-weight: 600;
    font-family: var(--font-sans);
    color: var(--text-primary);
    background: #1f2937;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    user-select: none;
}

.subtitle-btn:hover {
    background: #374151;
    border-color: #38bdf8;
    color: #fff;
    box-shadow: var(--shadow-sm);
}

.subtitle-btn.btn-play-pause {
    background: rgba(56, 189, 248, 0.16);
    border-color: rgba(56, 189, 248, 0.55);
    color: #38bdf8;
}

.subtitle-btn.btn-play-pause:hover {
    background: rgba(56, 189, 248, 0.28);
    border-color: #38bdf8;
    color: #fff;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.3);
}

.subtitle-btn.btn-close-sub {
    padding: 4px 8px;
    color: #94a3b8;
}

.subtitle-btn.btn-close-sub:hover {
    color: #ef4444;
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.15);
}

.subtitle-text-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: rgba(0, 0, 0, 0.25);
    padding: 7px 12px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.subtitle-wave-bars {
    display: flex;
    align-items: flex-end;
    gap: 2.5px;
    height: 15px;
    margin-top: 3px;
    flex-shrink: 0;
}

.subtitle-wave-bars span {
    width: 2.5px;
    background: #38bdf8;
    border-radius: 2px;
    animation: subPulseWave 1s infinite ease-in-out;
}

.subtitle-wave-bars span:nth-child(1) { height: 6px; animation-delay: 0.1s; }
.subtitle-wave-bars span:nth-child(2) { height: 13px; animation-delay: 0.3s; }
.subtitle-wave-bars span:nth-child(3) { height: 8px; animation-delay: 0.2s; }
.subtitle-wave-bars span:nth-child(4) { height: 11px; animation-delay: 0.4s; }

@keyframes subPulseWave {
    0%, 100% { transform: scaleY(0.4); opacity: 0.5; }
    50% { transform: scaleY(1); opacity: 1; }
}

.subtitle-text {
    font-size: 0.82rem;
    color: #f1f5f9;
    line-height: 1.5;
    max-height: 65px;
    overflow-y: auto;
    flex: 1;
}

/* ==========================================================================
   INPUT DOCK
   ========================================================================== */
.chat-input-area {
    width: 100%;
    padding: 6px 20px 10px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

.input-card {
    width: 100%;
    max-width: 100%;
    margin: 0;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 6px 10px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-sm);
    transition: all 0.15s ease;
}

.input-card:focus-within {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25);
}

.chat-textarea {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-family: var(--font-sans);
    font-size: 0.88rem;
    line-height: 1.5;
    resize: none;
    min-height: 24px;
    max-height: 120px;
}

.input-action-btn {
    width: 28px;
    height: 28px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.82rem;
    transition: all 0.15s ease;
}

.input-action-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-subtle);
    color: var(--text-primary);
}

.send-btn {
    width: 32px;
    height: 28px;
    background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
    border: none;
    border-radius: var(--radius-sm);
    color: #fff;
    box-shadow: 0 2px 4px rgba(2, 132, 199, 0.3);
    transition: all 0.15s ease;
}
.send-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-0.5px);
}
.send-btn:disabled { opacity: 0.35; background: #1e293b; border-color: transparent; cursor: not-allowed; box-shadow: none; transform: none; }

.image-preview-dock {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 6px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: 2px;
    margin-bottom: 3px;
    font-size: 0.7rem;
}

.image-preview-thumb {
    width: 20px;
    height: 20px;
    object-fit: cover;
    border-radius: 1px;
}

.image-preview-title {
    flex: 1;
    color: var(--npp-keyword);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-clear-preview {
    background: transparent;
    border: none;
    color: var(--npp-error);
    cursor: pointer;
}

.user-screenshot-thumb {
    max-width: 280px;
    max-height: 180px;
    object-fit: contain;
    border-radius: 2px;
    border: 1px solid var(--border-subtle);
    margin-bottom: 4px;
    display: block;
    cursor: pointer;
}

/* ==========================================================================
   RIGHT CURRICULUM TREE (ADVANCED SAAS SYLLABUS & LAB EXPLORER)
   ========================================================================== */
.curriculum-sidebar {
    width: 380px;
    min-width: 320px;
    max-width: 480px;
    background-color: var(--bg-secondary);
    border-left: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    height: 100vh;
    flex-shrink: 0;
    font-family: var(--font-sans);
    overflow: hidden;
    z-index: 100;
    transition: margin-right 0.2s ease;
}

.curriculum-sidebar.collapsed {
    display: none !important;
}

/* Course Tabs Switcher in Curriculum */
.course-tabs-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

.course-tab-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 10px;
    font-size: 0.74rem;
    font-family: var(--font-sans);
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.course-tab-btn:hover {
    color: var(--text-primary);
    background: var(--bg-main);
    border-color: var(--border-focus);
}

.course-tab-btn.active {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.15);
    border-color: rgba(56, 189, 248, 0.6);
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.2);
}

.curriculum-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-tertiary);
    height: 38px;
    flex-shrink: 0;
}

.curriculum-title-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.curriculum-badge {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: #38bdf8;
    font-weight: 700;
}

.course-name {
    font-family: var(--font-heading);
    font-size: 0.86rem;
    color: #fff;
    font-weight: 700;
    letter-spacing: -0.01em;
}

/* Tree Toolbar & Search */
.curriculum-tree-toolbar {
    padding: 6px 10px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: var(--bg-secondary);
}

.curriculum-search-wrap {
    position: relative;
    width: 100%;
}

.curriculum-search-wrap .search-icon {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.72rem;
}

.curriculum-search-input {
    width: 100%;
    background: var(--bg-main);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 4px 8px 4px 26px;
    color: #fff;
    font-family: var(--font-sans);
    font-size: 0.74rem;
    outline: none;
    transition: all 0.15s ease;
}
.curriculum-search-input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25);
}

.tree-bulk-actions {
    display: flex;
    gap: 5px;
}

.tree-tool-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    padding: 2px 7px;
    font-size: 0.68rem;
    font-family: var(--font-sans);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}
.tree-tool-btn:hover {
    background: #1e293b;
    color: #fff;
    border-color: var(--border-focus);
}

/* Tree Structure & Dotted Connector Guidelines */
.curriculum-content-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 6px 8px 24px;
}

.tree-root-list,
.tree-children-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.tree-children-list {
    margin-left: 10px;
    padding-left: 8px;
    border-left: 1px dotted rgba(255, 255, 255, 0.15);
}

.tree-branch-node.collapsed > .tree-children-list {
    display: none !important;
}

.tree-item {
    margin: 2px 0;
}

.tree-node-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    user-select: none;
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 0.76rem;
    border: 1px solid transparent;
    transition: all 0.12s ease;
}

.tree-node-row:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.08);
}

.tree-leaf-node .leaf-row {
    cursor: pointer;
    transition: all 0.12s ease;
}

.tree-leaf-node .leaf-row:hover {
    background: rgba(56, 189, 248, 0.12);
    border-color: rgba(56, 189, 248, 0.4);
}

.course-node-row {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    margin-bottom: 4px;
    font-weight: 700;
}

.tree-toggle-btn {
    width: 15px;
    height: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: var(--bg-main);
    color: var(--npp-string);
    border-radius: 3px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.65rem;
    flex-shrink: 0;
    line-height: 1;
    padding: 0;
    font-family: var(--font-mono);
}

.tree-toggle-btn:hover {
    background: #1e293b;
    border-color: var(--border-focus);
    color: #fff;
}

.tree-node-title {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}

.tree-node-row:hover .tree-node-title {
    color: #fff;
}

.tree-row-actions {
    display: flex;
    align-items: center;
    gap: 3px;
    opacity: 0.6;
}
.tree-node-row:hover .tree-row-actions {
    opacity: 1;
}

.raise-hand-btn,
.tree-copy-btn {
    width: 18px;
    height: 18px;
    border-radius: 2px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.68rem;
    padding: 0;
    flex-shrink: 0;
}
.raise-hand-btn:hover {
    color: var(--npp-warn);
    border-color: var(--npp-warn);
    background: rgba(229, 165, 10, 0.15);
}
.tree-copy-btn:hover {
    color: var(--npp-keyword);
    border-color: var(--npp-keyword);
    background: rgba(86, 156, 214, 0.15);
}

/* Category & Leaf Badges */
.spec-pill-badge,
.module-pill-badge,
.domain-num-tag,
.lesson-pill-badge,
.lab-pill-badge,
.quiz-pill-badge,
.qa-pill-badge,
.leaf-badge {
    font-size: 0.6rem;
    padding: 0 4px;
    border-radius: 2px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-main);
    font-weight: 700;
    flex-shrink: 0;
}

.domain-num-tag { color: var(--npp-type); border-color: rgba(78, 201, 176, 0.4); }
.module-pill-badge { color: var(--npp-keyword); border-color: rgba(86, 156, 214, 0.4); }
.lab-pill-badge, .lab-badge { color: var(--npp-comment); border-color: rgba(106, 153, 85, 0.4); }
.quiz-pill-badge, .quiz-badge { color: var(--npp-function); border-color: rgba(220, 220, 170, 0.4); }
.qa-pill-badge, .qa-badge { color: var(--npp-string); border-color: rgba(206, 145, 120, 0.4); }
.spec-pill-badge { color: #dcdcaa; border-color: rgba(220, 220, 170, 0.4); }
.lesson-pill-badge { color: #9cdcfe; border-color: rgba(156, 220, 254, 0.4); }

.leaf-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 2px 6px;
}

.leaf-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.72rem;
    color: var(--text-primary);
}

.leaf-ttl-badge {
    font-size: 0.62rem;
    color: var(--npp-comment);
}

.btn-item-run {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    border-radius: 2px;
    padding: 1px 5px;
    font-size: 0.65rem;
    font-family: var(--font-mono);
    cursor: pointer;
}
.btn-item-run:hover {
    background: #0e639c;
    border-color: #1177bb;
    color: #fff;
}

/* ==========================================================================
   2-MCQ KNOWLEDGE CHECK & UNDERSTANDING ASSESSMENT
   ========================================================================== */
.mcq-knowledge-card {
    background: rgba(17, 24, 39, 0.95);
    border: 1px solid var(--border-subtle);
    border-left: 3px solid #fbbf24;
    border-radius: var(--radius-md);
    padding: 12px 14px;
    margin: 8px 0;
    font-family: var(--font-sans);
    box-shadow: var(--shadow-sm);
}

.mcq-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.mcq-badge {
    font-family: var(--font-heading);
    font-size: 0.74rem;
    font-weight: 700;
    color: #fbbf24;
}

.mcq-diff-tag {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-muted);
}

.mcq-question {
    font-family: var(--font-heading);
    font-size: 0.88rem;
    color: #f8fafc;
    margin-bottom: 8px;
    font-weight: 600;
    line-height: 1.45;
}

.mcq-options-grid {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mcq-opt-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 7px 10px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.8rem;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
}
.mcq-opt-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-focus);
    color: #fff;
}

.opt-letter-badge {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-main);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    color: #38bdf8;
    flex-shrink: 0;
}

.mcq-opt-btn.opt-correct {
    border-color: #34d399;
    background: rgba(52, 211, 153, 0.15);
    color: #a7f3d0;
}
.mcq-opt-btn.opt-correct .opt-letter-badge {
    background: #34d399;
    color: #064e3b;
}

.mcq-opt-btn.opt-incorrect {
    border-color: #f87171;
    background: rgba(248, 113, 113, 0.15);
    color: #fecaca;
}
.mcq-opt-btn.opt-incorrect .opt-letter-badge {
    background: #f87171;
    color: #7f1d1d;
}

.mcq-result-box {
    margin-top: 8px;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    font-family: var(--font-sans);
    font-size: 0.78rem;
    line-height: 1.5;
}
.result-good {
    background: rgba(52, 211, 153, 0.1);
    border-color: #34d399;
    color: #a7f3d0;
}
.result-not-good {
    background: rgba(248, 113, 113, 0.1);
    border-color: #f87171;
    color: #fecaca;
}

/* Assessment Summary */
.assessment-summary-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    margin-top: 10px;
    font-family: var(--font-sans);
    box-shadow: var(--shadow-sm);
}
.score-perfect { border-left: 3px solid #34d399; }
.score-needs-review { border-left: 3px solid #fbbf24; }

.assessment-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.assessment-headline {
    font-family: var(--font-heading);
    font-size: 0.86rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}

.assessment-desc {
    font-size: 0.78rem;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.5;
}

.assessment-actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.btn-explain-diff {
    background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
    border: none;
    color: #fff;
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 0.74rem;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(2, 132, 199, 0.25);
    transition: all 0.15s ease;
}
.btn-explain-diff:hover {
    filter: brightness(1.1);
    transform: translateY(-0.5px);
}

.btn-proceed-topic {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 0.74rem;
    font-weight: 600;
    transition: all 0.15s ease;
}
.btn-proceed-topic:hover {
    background: #1e293b;
    border-color: var(--border-focus);
    color: #fff;
}

/* ==========================================================================
   SETTINGS MODAL & BACKDROP (HIDDEN BY DEFAULT)
   ========================================================================== */
.modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 99999;
    align-items: center;
    justify-content: center;
}

.modal-backdrop.show {
    display: flex;
}

.modal-box {
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    width: 460px;
    max-width: 90vw;
    font-family: var(--font-sans);
    padding: 18px;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 8px;
    margin-bottom: 12px;
}

.modal-header h3 {
    font-family: var(--font-heading);
    font-size: 0.98rem;
    color: #f8fafc;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.modal-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.85rem;
}

.settings-group {
    margin-bottom: 10px;
}

.settings-group label {
    display: block;
    font-size: 0.74rem;
    color: var(--text-muted);
    margin-bottom: 3px;
}

.settings-select {
    width: 100%;
    background: var(--bg-main);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 6px 10px;
    font-family: var(--font-sans);
    font-size: 0.78rem;
    border-radius: var(--radius-sm);
    outline: none;
    transition: all 0.15s ease;
}
.settings-select:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25);
}

.setting-hint {
    display: block;
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 3px;
}

.range-slider {
    width: 100%;
}

.engine-badge-list {
    display: flex;
    gap: 6px;
    margin-top: 4px;
}

.engine-badge {
    font-size: 0.7rem;
    font-family: var(--font-sans);
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    background: var(--bg-main);
    color: var(--text-muted);
}

.engine-badge.active {
    color: #34d399;
    border-color: #34d399;
    background: rgba(52, 211, 153, 0.1);
}

.ai-status-box {
    background: var(--bg-main);
    border: 1px solid var(--border-subtle);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 0.74rem;
    color: #34d399;
}

.modal-footer {
    border-top: 1px solid var(--border-subtle);
    padding-top: 12px;
    margin-top: 14px;
    text-align: right;
}

.btn-primary {
    background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
    border: none;
    color: #fff;
    padding: 6px 16px;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(2, 132, 199, 0.3);
    transition: all 0.15s ease;
}
.btn-primary:hover {
    filter: brightness(1.1);
    transform: translateY(-0.5px);
}

/* Flying topic animation */
.flying-topic-pill {
    position: fixed;
    z-index: 999999;
    pointer-events: none;
    background: #0e639c;
    border: 1px solid #1177bb;
    color: #fff;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 2px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 5px;
}

.floating-hand-toast {
    position: fixed;
    z-index: 1000000;
    pointer-events: none;
    background: var(--bg-secondary);
    border: 1px solid var(--npp-warn);
    color: #fff;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    padding: 3px 6px;
    border-radius: 2px;
    animation: toastFloat 1.2s forwards ease;
}

@keyframes toastFloat {
    0% { opacity: 0; transform: translateY(4px); }
    15% { opacity: 1; transform: translateY(0); }
    80% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-10px); }
}

/* AWS Workspace split mode */
.aws-workspace-pane {
    display: none;
    flex-direction: column;
    flex: 1.5;
    background: var(--bg-main);
    border-left: 1px solid var(--border-subtle);
    height: 100vh;
}

.app-layout.split-mode .aws-workspace-pane {
    display: flex;
}

/* Responsive */
@media (max-width: 820px) {
    .curriculum-sidebar {
        position: fixed;
        right: 0;
        top: 0;
        bottom: 0;
        z-index: 999;
        transform: translateX(100%);
        transition: transform 0.25s ease;
    }
    .curriculum-sidebar.open {
        transform: translateX(0);
    }
}

/* Floating Scroll to Latest Button */
.scroll-to-latest-btn {
    position: absolute;
    bottom: 96px;
    right: 28px;
    z-index: 100;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: var(--font-sans);
    color: #ffffff;
    background: #6366f1;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(8px);
}
.scroll-to-latest-btn:hover {
    background: #4f46e5;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(99, 102, 241, 0.5);
}
.scroll-to-latest-btn i {
    font-size: 0.85rem;
    animation: bounceDown 1.5s infinite;
}
@keyframes bounceDown {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(3px); }
}

/* Password Field & Toggle View Button */
.password-field-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.masked-password {
    letter-spacing: 2px;
    font-family: var(--font-mono, monospace);
    background: rgba(0, 0, 0, 0.35);
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid var(--border-subtle, #333);
}
.btn-toggle-pwd {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #e2e8f0;
    background: #334155;
    border: 1px solid #475569;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.btn-toggle-pwd:hover {
    background: #475569;
    color: #38bdf8;
    border-color: #38bdf8;
}

/* Screen Capture Button & Image Preview Dock */
.screen-capture-btn:hover {
    color: #38bdf8;
    border-color: #38bdf8;
}
.image-preview-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.image-size-badge {
    font-size: 0.68rem;
    color: #10b981;
    font-family: var(--font-mono, monospace);
    font-weight: 600;
}

