/**
 * AI Edu Legal & Party Document Reader - App Stylesheet
 * Scoped under .aiedu-doc-reader-root to prevent any CSS collisions.
 *
 * @author Luong Huu Nam
 * @version 1.0.7
 */

.aiedu-doc-reader-root {
    --aiedu-base-font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: var(--aiedu-base-font-size);
    color: #1e293b;
    box-sizing: border-box;
    margin-top: 15px;
}

.aiedu-doc-reader-root *,
.aiedu-doc-reader-root *::before,
.aiedu-doc-reader-root *::after {
    box-sizing: inherit;
}

/* Utilities */
.aiedu-flex { display: flex; align-items: center; }
.aiedu-gap-2 { gap: 8px; }
.aiedu-mt-2 { margin-top: 8px; }
.aiedu-mt-3 { margin-top: 16px; }
.aiedu-mb-4 { margin-bottom: 24px; }

/* Buttons */
.aiedu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 36px;
    height: auto;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: max(12px, 0.92em);
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
    transition: all 0.15s ease;
    white-space: nowrap;
    box-sizing: border-box;
}

.aiedu-btn-sm {
    min-height: 30px;
    height: auto;
    padding: 4px 10px;
    font-size: max(11px, 0.85em);
}

.aiedu-btn-primary { background: #2563eb; color: #ffffff; }
.aiedu-btn-primary:hover { background: #1d4ed8; color: #ffffff; }
.aiedu-btn-secondary { background: #f1f5f9; color: #334155; border-color: #cbd5e1; }
.aiedu-btn-secondary:hover { background: #e2e8f0; color: #0f172a; }
.aiedu-btn-success { background: #16a34a; color: #ffffff; }
.aiedu-btn-success:hover { background: #15803d; color: #ffffff; }
.aiedu-btn-danger { background: #ef4444; color: #ffffff; }
.aiedu-btn-danger:hover { background: #dc2626; color: #ffffff; }
.aiedu-test-ai-btn { flex-shrink: 0; }

/* Fullscreen Mode Button */
.aiedu-fullscreen-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 28px;
    height: 28px;
    padding: 0 10px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    color: #334155;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    flex-shrink: 0;
}

.aiedu-fullscreen-btn:hover {
    background: #f1f5f9;
    color: #2563eb;
    border-color: #94a3b8;
}

.aiedu-fullscreen-btn:active {
    transform: scale(0.96);
}

/* Font Size Controls (A- / 14px / A+) */
.aiedu-font-controls {
    display: inline-flex;
    align-items: center;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 2px;
    gap: 2px;
    user-select: none;
    flex-shrink: 0;
}

.aiedu-font-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 24px;
    padding: 0 7px;
    border: none;
    background: transparent;
    color: #334155;
    font-size: 12px;
    font-weight: 700;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.aiedu-font-btn:hover {
    background: #ffffff;
    color: #1d4ed8;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.aiedu-font-btn:active {
    transform: scale(0.95);
}

.aiedu-font-display {
    font-size: 11px;
    font-weight: 600;
    color: #2563eb;
    min-width: 38px;
    text-align: center;
    cursor: pointer;
}

.aiedu-font-display:hover {
    background: #e2e8f0;
}

/* Splitter Resizer Elements */
.aiedu-resizer {
    flex: 0 0 6px;
    width: 6px;
    background: #f1f5f9;
    border-left: 1px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
    cursor: col-resize;
    position: relative;
    transition: background 0.15s ease, border-color 0.15s ease;
    user-select: none;
    z-index: 10;
}

.aiedu-resizer:hover,
.aiedu-resizer.is-resizing {
    background: #3b82f6 !important;
    border-color: #2563eb !important;
}

.aiedu-resizer::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2px;
    height: 24px;
    background: #94a3b8;
    border-radius: 1px;
    transition: background 0.15s ease;
}

.aiedu-resizer:hover::after,
.aiedu-resizer.is-resizing::after {
    background: #ffffff;
}

.aiedu-resizer.aiedu-resizer-ai-col {
    flex: 0 0 8px;
    width: 8px;
    background: #cbd5e1;
    border-left: 1px solid #94a3b8;
    border-right: 1px solid #94a3b8;
    cursor: col-resize;
    z-index: 25;
}

.aiedu-resizer.aiedu-resizer-ai-col::after {
    height: 38px;
    width: 4px;
    background: #64748b;
    border-radius: 2px;
}

.aiedu-resizer.aiedu-resizer-ai-col:hover,
.aiedu-resizer.aiedu-resizer-ai-col.is-resizing {
    background: #2563eb !important;
    border-color: #1d4ed8 !important;
}

.aiedu-resizer.aiedu-resizer-ai-col:hover::after,
.aiedu-resizer.aiedu-resizer-ai-col.is-resizing::after {
    background: #ffffff !important;
}

/* Right Edge Resizer for Draft Canvas */
.aiedu-resizer.aiedu-resizer-draft-right {
    flex: 0 0 8px;
    width: 8px;
    background: #cbd5e1;
    border-left: 1px solid #94a3b8;
    border-right: 1px solid #cbd5e1;
    cursor: col-resize;
    z-index: 25;
    position: relative;
    user-select: none;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.aiedu-resizer.aiedu-resizer-draft-right::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 4px;
    height: 38px;
    background: #64748b;
    border-radius: 2px;
    transition: all 0.15s ease;
}

.aiedu-resizer.aiedu-resizer-draft-right:hover,
.aiedu-resizer.aiedu-resizer-draft-right.is-resizing {
    background: #2563eb !important;
    border-color: #1d4ed8 !important;
}

.aiedu-resizer.aiedu-resizer-draft-right:hover::after,
.aiedu-resizer.aiedu-resizer-draft-right.is-resizing::after {
    background: #ffffff !important;
    height: 56px;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
}

body.aiedu-is-resizing {
    cursor: col-resize !important;
    user-select: none !important;
}

/* Dynamic Workspace Layout with Splitter */
.aiedu-workspace-layout {
    display: flex;
    width: 100% !important;
    max-width: 100% !important;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    height: calc(100vh - 120px);
    min-height: 600px;
    overflow: hidden;
    overflow-x: hidden !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    box-sizing: border-box !important;
}

/* Resizable Left Sidebar */
.aiedu-sidebar-pane {
    flex: 0 0 auto;
    width: 320px;
    min-width: 240px;
    max-width: 65%;
    background: #fafafa;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.aiedu-sidebar-header {
    padding: 16px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
}

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

.aiedu-brand-title h2 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
}

.aiedu-brand-icon { color: #2563eb; }

/* Luxury 3D Glossy Obsidian & Amber Glow: System Filter Tabs */
.aiedu-system-tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 10px 12px 6px;
    padding: 4px;
    background: linear-gradient(180deg, #18181b 0%, #09090b 100%);
    border: 1px solid #27272a;
    border-radius: 10px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.7), 0 1px 1px rgba(255, 255, 255, 0.06);
    overflow-x: auto;
    scrollbar-width: none;
}

.aiedu-system-tabs::-webkit-scrollbar {
    display: none;
}

.aiedu-sys-tab {
    flex: 1;
    min-width: 0;
    height: 36px;
    background: transparent;
    border: 1.5px solid transparent;
    border-radius: 7px;
    font-size: 11.5px;
    font-weight: 600;
    color: #a1a1aa;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0 6px;
    white-space: nowrap;
    user-select: none;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.aiedu-sys-tab:hover {
    color: #f4f4f5;
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(245, 158, 11, 0.3);
}

.aiedu-sys-tab.active {
    background: linear-gradient(180deg, #27272a 0%, #1c1917 55%, #0c0a09 100%);
    color: #fbbf24;
    font-weight: 700;
    border-color: #f59e0b;
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.22), inset 0 -1px 0 rgba(0, 0, 0, 0.8), 0 2px 4px rgba(0, 0, 0, 0.5);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.aiedu-sys-tab:active {
    transform: scale(0.98);
}

.aiedu-tab-icon {
    font-size: 13px;
    line-height: 1;
    display: inline-block;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.aiedu-sys-tab.active .aiedu-tab-icon {
    filter: drop-shadow(0 0 4px rgba(245, 158, 11, 0.6));
    transform: scale(1.05);
}

.aiedu-tab-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.aiedu-tab-badge {
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
    padding: 2px 5px;
    border-radius: 4px;
    background: #27272a;
    color: #a1a1aa;
    border: 1px solid #3f3f46;
    letter-spacing: 0.3px;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.aiedu-sys-tab:hover .aiedu-tab-badge {
    color: #e4e4e7;
    border-color: #52525b;
}

.aiedu-sys-tab.active .aiedu-tab-badge {
    background: #451a03;
    color: #fef08a;
    border: 1px solid #d97706;
    box-shadow: 0 0 6px rgba(217, 119, 6, 0.35);
}

/* Sidebar Search */
.aiedu-sidebar-search {
    padding: 10px 14px;
    border-bottom: 1px solid #e2e8f0;
    background: #ffffff;
}

.aiedu-search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 0 10px;
    height: 34px;
}

.aiedu-search-box input {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    width: 100%;
    font-size: 13px;
    padding: 0 !important;
}

/* Document List */
.aiedu-doc-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.aiedu-doc-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.aiedu-doc-card:hover {
    border-color: #2563eb;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.08);
}

.aiedu-doc-card.active {
    border-color: #2563eb;
    background: #eff6ff;
}

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

.aiedu-system-badge {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 3px;
    background: #e2e8f0;
    color: #334155;
}

.aiedu-badge-state { background: #dbeafe; color: #1d4ed8; }
.aiedu-badge-party { background: #fee2e2; color: #b91c1c; }
.aiedu-badge-internal { background: #e0e7ff; color: #4338ca; }

.aiedu-status-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 600;
}

.aiedu-badge-vectorized { background: #dcfce7; color: #166534; }
.aiedu-badge-uploaded   { background: #fef3c7; color: #92400e; }
.aiedu-badge-failed     { background: #fee2e2; color: #991b1b; }

.aiedu-card-title {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.35;
    margin: 4px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.aiedu-card-meta {
    font-size: 11px;
    color: #64748b;
    display: flex;
    gap: 8px;
}

/* 70% Right Main Workspace Pane - Auto stretches 100% to the right edge */
.aiedu-main-pane {
    flex: 1 1 0% !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    overflow: hidden;
    box-sizing: border-box !important;
}

.aiedu-main-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: #94a3b8;
}

.aiedu-placeholder-icon { color: #cbd5e1; margin-bottom: 12px; }

/* Active Workspace */
.aiedu-active-workspace {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.aiedu-doc-header {
    padding: 6px 16px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    flex-shrink: 0;
    min-height: 42px;
}

.aiedu-doc-meta-block {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.aiedu-view-title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    min-width: 0;
}

.aiedu-view-title {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 550px;
    line-height: 1.3;
}

.aiedu-view-meta-row {
    font-size: 12px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    flex-shrink: 0;
}

.aiedu-doc-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.aiedu-doc-actions .aiedu-btn {
    padding: 4px 10px;
    font-size: 12px;
    height: 30px;
    line-height: 1;
    gap: 5px;
}

.aiedu-doc-actions .aiedu-fullscreen-btn {
    width: 30px;
    height: 30px;
}

/* Workspace Tabs - Luxury 3D Glossy Obsidian & Amber Glow */
.aiedu-workspace-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: linear-gradient(180deg, #18181b 0%, #0f172a 100%);
    border-bottom: 1px solid #27272a;
    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.5), 0 2px 4px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.aiedu-workspace-tabs::-webkit-scrollbar {
    display: none;
}

.aiedu-ws-tab {
    padding: 0 18px;
    height: 40px;
    background: rgba(255, 255, 255, 0.03);
    border: 1.5px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #94a3b8;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    white-space: nowrap;
    position: relative;
}

.aiedu-ws-tab:hover {
    color: #f8fafc;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(245, 158, 11, 0.35);
}

.aiedu-ws-tab.active {
    color: #fbbf24;
    background: linear-gradient(180deg, #27272a 0%, #1c1917 55%, #0c0a09 100%);
    font-weight: 700;
    border-color: #f59e0b;
    box-shadow: 0 0 14px rgba(245, 158, 11, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.22), inset 0 -1px 0 rgba(0, 0, 0, 0.8), 0 2px 5px rgba(0, 0, 0, 0.5);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.aiedu-ws-tab:active {
    transform: scale(0.98);
}

.aiedu-ws-tab svg {
    color: #94a3b8;
    transition: all 0.2s ease;
}

.aiedu-ws-tab:hover svg {
    color: #f1f5f9;
}

.aiedu-ws-tab.active svg {
    color: #fbbf24;
    filter: drop-shadow(0 0 5px rgba(245, 158, 11, 0.65));
}

/* Tab Panels */
.aiedu-tab-panel {
    flex: 1;
    overflow: hidden;
    display: none;
}

.aiedu-tab-panel.active {
    display: flex;
}

/* Tab 1: Read Container & Outline Explorer */
.aiedu-read-container {
    display: flex;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.aiedu-outline-explorer {
    flex: 0 0 auto;
    width: 260px;
    min-width: 180px;
    max-width: 50%;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.aiedu-outline-title {
    padding: 12px 14px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 12px;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 6px;
}

.aiedu-outline-tree {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.aiedu-outline-item,
.aiedu-tree-node {
    font-size: 13px;
    line-height: 1.5;
    padding: 7px 10px;
    border-radius: 5px;
    cursor: pointer;
    color: #334155;
    margin-bottom: 4px;
    text-align: justify;
    text-justify: inter-word;
    word-break: break-word;
    border-left: 3px solid transparent;
    transition: all 0.15s ease;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 6px;
}

.aiedu-outline-item:hover,
.aiedu-tree-node:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.aiedu-outline-item.active,
.aiedu-tree-node.active {
    background: #eff6ff;
    color: #1d4ed8;
    font-weight: 600;
    border-left-color: #2563eb;
}

.aiedu-outline-text {
    flex: 1;
    text-align: justify;
    text-justify: inter-word;
}

.aiedu-chunks-stream {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: #ffffff;
}

.aiedu-chunk-card {
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 14px 16px;
    background: #ffffff;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.aiedu-chunk-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.aiedu-chunk-card.active {
    background-color: #fef9c3 !important;
    border-color: #fde047 !important;
    box-shadow: 0 0 0 2px rgba(234, 179, 8, 0.25), 0 2px 8px rgba(0, 0, 0, 0.05);
}

.aiedu-chunk-path {
    font-size: 11px;
    font-weight: 700;
    color: #2563eb;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.aiedu-chunk-body {
    font-size: 14px;
    line-height: 1.6;
    color: #1e293b;
    white-space: pre-line;
    text-align: justify;
    text-justify: inter-word;
}

.aiedu-chunk-card,
.aiedu-chunk-card p,
.aiedu-chunk-lead,
.aiedu-chunk-point-item,
.aiedu-chunk-point-content {
    text-align: justify;
    text-justify: inter-word;
}

/* Tab 2: Split-View AI Assistant */
.aiedu-ai-split-view {
    display: flex;
    width: 100% !important;
    max-width: 100% !important;
    height: 100%;
    overflow: hidden;
    box-sizing: border-box !important;
}

.aiedu-ai-chat-column {
    flex: 0 0 auto;
    width: 45%;
    min-width: 280px;
    max-width: 70%;
    display: flex;
    flex-direction: column;
    background: #fafafa;
}

.aiedu-ai-mode-selector {
    padding: 10px 14px;
    border-bottom: 1px solid #e2e8f0;
    background: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.aiedu-mode-radios {
    display: flex;
    gap: 14px;
    align-items: center;
    flex-wrap: wrap;
}

.aiedu-mode-radio {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.aiedu-chat-stream {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.aiedu-chat-msg {
    display: flex;
    max-width: 90%;
}

.aiedu-msg-user { align-self: flex-end; }
.aiedu-msg-ai   { align-self: flex-start; }

.aiedu-msg-bubble {
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.5;
}

.aiedu-msg-user .aiedu-msg-bubble {
    background: #2563eb;
    color: #ffffff;
    border-bottom-right-radius: 2px;
}

.aiedu-msg-ai .aiedu-msg-bubble {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #1e293b;
    border-bottom-left-radius: 2px;
    text-align: justify;
    text-justify: inter-word;
}

.aiedu-msg-ai .aiedu-msg-bubble p,
.aiedu-msg-ai .aiedu-msg-bubble div,
.aiedu-msg-ai .aiedu-msg-bubble li {
    text-align: justify;
    text-justify: inter-word;
}

.aiedu-citation-badge,
.aiedu-citation-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 5px;
    font-weight: 600;
    margin-top: 6px;
    margin-right: 6px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.aiedu-citation-link:hover {
    background: #dbeafe;
    color: #1e40af;
    border-color: #93c5fd;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.15);
    transform: translateY(-1px);
}

.aiedu-citation-link svg {
    flex-shrink: 0;
    color: #2563eb;
}

.aiedu-chat-input-form {
    padding: 10px 14px;
    border-top: 1px solid #e2e8f0;
    background: #ffffff;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.aiedu-chat-input-form textarea {
    flex: 1;
    height: 96px;
    min-height: 96px;
    max-height: 240px;
    resize: vertical;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 13.5px;
    line-height: 1.5;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.aiedu-chat-input-form textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.aiedu-chat-actions-col {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 96px;
    width: 195px;
    min-width: 180px;
    gap: 8px;
    flex-shrink: 0;
    box-sizing: border-box;
}

.aiedu-chat-actions-col #aiedu_send_query_btn {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 700;
    border-radius: 6px;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.2);
    cursor: pointer;
    transition: all 0.15s ease;
}

.aiedu-prompt-select-wrap {
    width: 100%;
}

.aiedu-prompt-select {
    width: 100%;
    height: 38px;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background-color: #f8fafc;
    color: #1e293b;
    cursor: pointer;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}

.aiedu-prompt-select:focus,
.aiedu-prompt-select:hover {
    border-color: #2563eb;
    background-color: #ffffff;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

/* Right Draft Canvas (A4 Sheet Preview) */
.aiedu-ai-draft-column {
    flex: 1 1 0% !important;
    width: auto;
    min-width: 320px;
    display: flex;
    flex-direction: column;
    background: #e2e8f0;
    overflow: hidden;
    position: relative;
    box-sizing: border-box !important;
}

/* Maximized A4 Draft View Mode */
.aiedu-ai-split-view.aiedu-a4-maximized .aiedu-ai-chat-column {
    display: none !important;
}

.aiedu-ai-split-view.aiedu-a4-maximized #aiedu_resizer_ai,
.aiedu-ai-split-view.aiedu-a4-maximized #aiedu_resizer_draft_right {
    display: none !important;
}

.aiedu-ai-split-view.aiedu-a4-maximized .aiedu-ai-draft-column {
    flex: 1 1 100% !important;
    width: 100% !important;
}

.aiedu-draft-toolbar {
    padding: 8px 14px;
    background: #ffffff;
    border-bottom: 1px solid #cbd5e1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.aiedu-draft-toolbar h4 {
    margin: 0;
    font-size: 13.5px;
    font-weight: 700;
    color: #1e293b;
    white-space: nowrap;
}

.aiedu-draft-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

/* Chunk Highlight pulse when jumping from Citation */
@keyframes aiedu-chunk-pulse {
    0% { background-color: #fef08a; border-color: #eab308; box-shadow: 0 0 0 4px rgba(234, 179, 8, 0.4); }
    50% { background-color: #fef9c3; border-color: #facc15; box-shadow: 0 0 0 8px rgba(234, 179, 8, 0.2); }
    100% { background-color: #ffffff; border-color: #e2e8f0; box-shadow: none; }
}

.aiedu-chunk-highlighted {
    animation: aiedu-chunk-pulse 3s ease-out forwards !important;
}

.aiedu-a4-page-preview {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px 6px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    background: #e2e8f0;
    box-sizing: border-box;
}

.aiedu-a4-page {
    width: 210mm;
    min-height: 297mm;
    padding: 20mm 15mm 20mm 30mm; /* Chuẩn thể thức Đảng HD 05: Trên 20, dưới 20, trái 30, phải 15 */
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-family: "Times New Roman", Times, serif;
    font-size: 14pt;
    line-height: 1.5;
    color: #000000;
    outline: none;
    transition: transform 0.15s ease, width 0.15s ease;
    transform-origin: top center;
    text-align: justify;
    text-justify: inter-word;
}

.aiedu-a4-page p,
.aiedu-a4-page div:not(.aiedu-doc-header):not(.aiedu-doc-header-center):not(.aiedu-doc-sign) {
    text-align: justify;
    text-justify: inter-word;
    text-indent: 1.25cm;
    margin-bottom: 6pt;
}

/* Thể thức đặc thù HD 05: Tiêu ngữ Đảng, Cơ quan ban hành, Tiêu đề */
.aiedu-a4-page .aiedu-doc-header-center,
.aiedu-a4-page h1,
.aiedu-a4-page h2,
.aiedu-a4-page h3,
.aiedu-a4-page .aiedu-doc-title {
    text-align: center !important;
    text-indent: 0 !important;
}

.aiedu-a4-page .aiedu-doc-sign {
    text-align: right !important;
    text-indent: 0 !important;
}

.aiedu-a4-page table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin: 12pt 0 !important;
    border: 1px solid #000000 !important;
    font-family: "Times New Roman", Times, serif !important;
    font-size: 13pt !important;
}

.aiedu-a4-page th,
.aiedu-a4-page td {
    border: 1px solid #000000 !important;
    padding: 6pt 8pt !important;
    vertical-align: top !important;
    text-indent: 0 !important;
}

.aiedu-a4-page th {
    font-weight: bold !important;
    text-align: center !important;
    background-color: #f8fafc !important;
}

.aiedu-a4-page ul,
.aiedu-a4-page ol {
    margin: 6pt 0 !important;
    padding-left: 28pt !important;
}

.aiedu-a4-page li {
    font-family: "Times New Roman", Times, serif !important;
    font-size: 14pt !important;
    line-height: 1.5 !important;
    margin-bottom: 4pt !important;
    text-align: justify !important;
    text-indent: 0 !important;
}

/* Chế độ Vừa khít khung nhìn (Fit to Width) */
.aiedu-a4-page.aiedu-a4-fit-width {
    width: 100% !important;
    max-width: 100% !important;
    min-height: auto;
    box-sizing: border-box;
    padding: 24px 30px !important;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
    transform: none !important;
}

.aiedu-empty-a4-hint {
    color: #94a3b8;
    font-style: italic;
    font-family: -apple-system, sans-serif;
    font-size: 13px;
    text-indent: 0 !important;
    text-align: left !important;
}

/* Split Presets & Mode Toggle Controls */
.aiedu-split-presets {
    display: inline-flex;
    align-items: center;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 2px;
    gap: 2px;
    user-select: none;
}

.aiedu-preset-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    height: 24px;
    padding: 0 8px;
    border: none;
    background: transparent;
    color: #475569;
    font-size: 11px;
    font-weight: 700;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.aiedu-preset-btn:hover {
    background: #ffffff;
    color: #1d4ed8;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.aiedu-preset-btn.active {
    background: #2563eb;
    color: #ffffff;
}

.aiedu-preset-btn svg {
    flex-shrink: 0;
}

.aiedu-mode-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 6px;
}

.aiedu-mode-toggle-btn.active {
    background: #e0e7ff;
    color: #3730a3;
    border-color: #c7d2fe;
}

/* Settings Full-Width Fluid SaaS Layout */
.aiedu-settings-wrap {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.aiedu-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

/* 4px Border-top semantic accents */
.aiedu-card-blue   { border-top: 4px solid #2563eb !important; }
.aiedu-card-green  { border-top: 4px solid #16a34a !important; }
.aiedu-card-amber  { border-top: 4px solid #d97706 !important; }
.aiedu-card-purple { border-top: 4px solid #7c3aed !important; }

.aiedu-card-header {
    padding: 14px 20px;
    border-bottom: 1px solid #e2e8f0;
    background: #fafafa;
}

.aiedu-card-header h3 {
    margin: 0;
    font-size: max(15px, 1.05em);
    font-weight: 700;
    color: #1e293b;
}

.aiedu-card-body {
    padding: 20px;
}

.aiedu-form-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    padding: 16px 0;
    border-bottom: 1px solid #f1f5f9;
    gap: 12px 24px;
}

.aiedu-form-row:last-child {
    border-bottom: none;
}

.aiedu-label-col {
    flex: 0 0 280px;
    max-width: 100%;
    display: flex;
    align-items: center;
    gap: 6px;
    padding-top: 6px;
}

.aiedu-label-col label {
    font-size: max(13px, 0.95em);
    font-weight: 600;
    color: #334155;
    line-height: 1.4;
}

.aiedu-input-col {
    flex: 1 1 320px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.aiedu-form-control {
    width: 100%;
    min-height: 38px;
    height: auto;
    padding: 6px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: max(13px, 0.95em);
    color: #1e293b;
    background: #ffffff;
    box-sizing: border-box;
}

.aiedu-form-control:focus {
    border-color: #2563eb;
    outline: none;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

/* Create New Collection Row */
.aiedu-create-coll-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px 16px;
    width: 100%;
}

.aiedu-create-coll-field {
    flex: 1 1 200px;
    min-width: 180px;
}

.aiedu-coll-btn-field {
    flex: 0 0 auto;
}

/* Adaptive Large Font Mode (>= 20px up to 40px) */
.aiedu-doc-reader-root.aiedu-large-font .aiedu-form-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}

.aiedu-doc-reader-root.aiedu-large-font .aiedu-label-col {
    flex: 0 0 100%;
    width: 100%;
    padding-top: 0;
}

.aiedu-doc-reader-root.aiedu-large-font .aiedu-input-col {
    flex: 0 0 100%;
    width: 100%;
}

.aiedu-doc-reader-root.aiedu-large-font .aiedu-create-coll-field {
    flex: 0 0 100%;
    width: 100%;
}

.aiedu-doc-reader-root.aiedu-large-font .aiedu-settings-nav-tabs {
    flex-wrap: wrap;
}

.aiedu-doc-reader-root.aiedu-large-font .aiedu-chunks-toolbar {
    flex-direction: column;
    align-items: stretch;
}

/* Fullscreen Mode - Edge to Edge */
.aiedu-doc-reader-root.is-fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 999999 !important;
    background: #f8fafc !important;
    margin: 0 !important;
    padding: 4px 6px !important;
    overflow: hidden !important;
    overflow-x: hidden !important;
    overflow-y: hidden !important;
    box-sizing: border-box !important;
}

body.aiedu-has-fullscreen {
    overflow: hidden !important;
}

body.aiedu-has-fullscreen #wpadminbar,
body.aiedu-has-fullscreen #adminmenumain {
    display: none !important;
}

.aiedu-doc-reader-root.is-fullscreen .aiedu-workspace-layout {
    height: calc(100vh - 8px) !important;
    width: 100% !important;
    max-height: none !important;
    border-radius: 4px !important;
}

/* Eliminate default WordPress admin padding on AI Edu Reader pages */
#wpcontent:has(.aiedu-doc-reader-root),
#wpbody-content:has(.aiedu-doc-reader-root),
body.toplevel_page_aiedu-doc-reader #wpcontent,
body.toplevel_page_aiedu-doc-reader #wpbody-content,
body[class*="aiedu-doc-reader"] #wpcontent,
body[class*="aiedu-doc-reader"] #wpbody-content {
    padding-right: 0 !important;
    margin-right: 0 !important;
}

.aiedu-input-with-action {
    display: flex;
    gap: 8px;
    width: 100%;
}

.aiedu-input-with-action .aiedu-form-control {
    flex: 1;
}

.aiedu-input-with-unit {
    display: flex;
    align-items: center;
    gap: 10px;
}

.aiedu-unit-label {
    color: #64748b;
    font-size: 13px;
}

/* Tooltip (?) WCAG 2.1 AA */
.aiedu-tooltip-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #475569;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    position: relative;
}

.aiedu-tooltip-trigger:hover,
.aiedu-tooltip-trigger:focus {
    background: #2563eb;
    color: #ffffff;
    outline: none;
}

.aiedu-tooltip-trigger::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: #0f172a;
    color: #ffffff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: normal;
    line-height: 1.4;
    white-space: normal;
    width: 260px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1000;
}

.aiedu-tooltip-trigger:hover::after,
.aiedu-tooltip-trigger:focus::after {
    opacity: 1;
    visibility: visible;
}

/* Modal Universal Architecture */
.aiedu-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999999;
    display: none;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.aiedu-modal.aiedu-modal-open,
.aiedu-modal.is-active {
    display: flex !important;
}

.aiedu-modal[style*="display: none"] {
    display: none !important;
}

.aiedu-modal .aiedu-modal-backdrop {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(15, 23, 42, 0.65) !important;
    backdrop-filter: blur(4px) !important;
    z-index: 1 !important;
}

.aiedu-modal .aiedu-modal-content {
    position: relative !important;
    z-index: 2 !important;
    background: #ffffff !important;
    border-radius: 12px !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
    margin: auto !important;
    box-sizing: border-box !important;
}

.aiedu-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999999;
}

.aiedu-modal-card {
    position: relative;
    z-index: 2;
    background: #ffffff;
    border-radius: 10px;
    width: 520px;
    max-width: 90%;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

/* Document Card Delete Button */
.aiedu-doc-card-delete-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 3px 8px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 4px;
    color: #dc2626;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-left: auto;
    line-height: 1.2;
}

.aiedu-doc-card-delete-btn:hover {
    background: #dc2626;
    color: #ffffff;
    border-color: #dc2626;
    box-shadow: 0 1px 3px rgba(220, 38, 38, 0.25);
}

.aiedu-modal-header {
    padding: 14px 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.aiedu-modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}

.aiedu-modal-close {
    background: transparent;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
}

.aiedu-modal-body { padding: 20px; }
.aiedu-modal-footer {
    padding: 12px 20px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    background: #f8fafc;
}

/* Dropzone */
.aiedu-dropzone {
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    background: #fafafa;
    transition: all 0.15s ease;
    position: relative;
}

.aiedu-dropzone:hover,
.aiedu-dropzone.dragover {
    border-color: #2563eb;
    background: #eff6ff;
}

.aiedu-dropzone-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.aiedu-drop-icon {
    color: #2563eb;
    margin-bottom: 8px;
}

.aiedu-drop-text {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 4px 0;
}

.aiedu-drop-or {
    font-size: 12px;
    color: #94a3b8;
    margin: 2px 0 8px 0;
}

.aiedu-browse-file-btn {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    padding: 9px 22px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    background: #2563eb !important;
    border-color: #2563eb !important;
    color: #ffffff !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    box-shadow: 0 2px 5px rgba(37, 99, 235, 0.25);
    transition: all 0.15s ease !important;
}

.aiedu-browse-file-btn:hover {
    background: #1d4ed8 !important;
    border-color: #1d4ed8 !important;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.35);
}

.aiedu-drop-hint {
    display: block;
    font-size: 11px;
    color: #64748b;
    margin-top: 10px;
}

/* File Selected Card View */
.aiedu-file-selected-card {
    background: #f0fdf4;
    border: 1.5px solid #86efac;
    border-radius: 8px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    text-align: left;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.aiedu-file-card-main {
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
}

.aiedu-file-badge {
    background: #2563eb;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.aiedu-file-badge.badge-docx {
    background: #0284c7;
}

.aiedu-file-details {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.aiedu-file-name {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 240px;
}

.aiedu-file-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #166534;
    margin-top: 2px;
}

.aiedu-file-ready-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
}

.aiedu-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 2px solid #cbd5e1;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: aiedu-spin 0.8s linear infinite;
}

@keyframes aiedu-spin { to { transform: rotate(360deg); } }

/* Create Collection Bar (Matching User Design) */
.aiedu-create-coll-box {
    background: #f8fafc;
    border-radius: 6px;
    padding: 14px 16px;
    border: 1px solid #e2e8f0;
}

.aiedu-create-coll-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.aiedu-create-coll-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.aiedu-create-coll-field label {
    font-size: 12px;
    font-weight: 600;
    color: #334155;
    white-space: nowrap;
}

.aiedu-coll-name-field {
    flex: 3;
    min-width: 260px;
}

.aiedu-coll-dim-field {
    flex: 2;
    min-width: 220px;
}

.aiedu-coll-metric-field {
    flex: 1.5;
    min-width: 170px;
}

.aiedu-coll-btn-field {
    flex: 0 0 auto;
}

.aiedu-coll-btn-field button {
    height: 38px;
    padding: 0 18px;
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
    background: #0284c7;
    border-color: #0284c7;
    color: #ffffff;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.15s ease;
}

.aiedu-coll-btn-field button:hover {
    background: #0369a1;
    border-color: #0369a1;
}

@media (max-width: 900px) {
    .aiedu-create-coll-row {
        flex-direction: column;
        align-items: stretch;
    }
    .aiedu-coll-btn-label {
        display: none;
    }
}

/* No Permission Block (Frontend Access Restriction) */
.aiedu-no-permission-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px 20px;
    background: #f8fafc;
    min-height: 420px;
    border-radius: 12px;
}

.aiedu-no-permission-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 40px 30px;
    max-width: 520px;
    width: 100%;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.aiedu-no-permission-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: #fef2f2;
    color: #dc2626;
    border-radius: 50%;
    margin: 0 auto 20px auto;
}

.aiedu-no-permission-title {
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 12px 0;
}

.aiedu-no-permission-desc {
    font-size: 14px;
    line-height: 1.6;
    color: #64748b;
    margin: 0 0 24px 0;
}

.aiedu-no-permission-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* =========================================================================
   Horizontal Tabs Navigation (Settings Page)
   ========================================================================= */
.aiedu-settings-nav-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.aiedu-settings-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 18px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    border-radius: 6px 6px 0 0;
    margin-bottom: -2px;
}

.aiedu-settings-tab-btn:hover {
    color: #2563eb;
    background: #f1f5f9;
}

.aiedu-settings-tab-btn.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
    background: #ffffff;
    font-weight: 700;
}

.aiedu-settings-tab-btn svg {
    flex-shrink: 0;
    color: inherit;
}

.aiedu-settings-tab-panel {
    display: block;
}

/* Card Indigo accent */
.aiedu-card-indigo {
    border-top: 4px solid #4f46e5 !important;
}

/* Chunks Counter Badge */
.aiedu-chunks-counter-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background: #e0e7ff;
    color: #3730a3;
    border: 1px solid #c7d2fe;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 600;
}

/* Chunks Table & Status Badges */
.aiedu-chunks-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: #ffffff;
}

.aiedu-chunks-table thead th {
    background: #f8fafc;
    padding: 12px 12px;
    font-weight: 600;
    color: #475569;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
}

.aiedu-chunks-table tbody tr {
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.15s ease;
}

.aiedu-chunks-table tbody tr:hover {
    background-color: #f8fafc;
}

.aiedu-chunk-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}

.aiedu-chunk-status-badge.badge-ready {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.aiedu-chunk-title-wrap {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.aiedu-chunk-title {
    font-weight: 600;
    color: #1e293b;
    line-height: 1.4;
    word-break: break-word;
}

.aiedu-chunk-meta {
    font-size: 12px;
    color: #64748b;
}

.aiedu-chunk-source-tag {
    display: inline-block;
    padding: 3px 8px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 12px;
    color: #475569;
}

.aiedu-chunk-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
}

.aiedu-chunk-icon-btn:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #1e293b;
}

.aiedu-chunk-icon-btn.text-danger:hover {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #dc2626 !important;
}

@keyframes aiedu-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   Tab 1: Outline Explorer & Stream Font Controls + Headers
   ========================================================================== */
.aiedu-outline-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
    flex-shrink: 0;
}

.aiedu-chunks-stream-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
    background: #ffffff;
}

.aiedu-stream-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
    flex-shrink: 0;
    z-index: 5;
    gap: 12px;
    flex-wrap: wrap;
}

.aiedu-stream-title {
    font-size: 13px;
    font-weight: 700;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.aiedu-stream-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Outline Explorer Search Bar (Tab 1) */
.aiedu-outline-search {
    padding: 8px 10px 6px 10px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.aiedu-outline-search-wrapper {
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 3px 8px;
    gap: 6px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: all 0.15s ease;
}

.aiedu-outline-search-wrapper:focus-within {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.18);
}

.aiedu-outline-search-wrapper input {
    border: none !important;
    outline: none !important;
    background: transparent !important;
    font-size: 12px !important;
    color: #1e293b !important;
    width: 100% !important;
    flex: 1 !important;
    padding: 2px 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
}

.aiedu-outline-search-wrapper input::placeholder {
    color: #94a3b8;
}

.aiedu-search-icon {
    display: inline-flex;
    align-items: center;
    color: #64748b;
    flex-shrink: 0;
}

.aiedu-search-clear-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 1px 4px;
    font-size: 11px;
    border-radius: 3px;
    transition: all 0.15s ease;
    line-height: 1;
    user-select: none;
}

.aiedu-search-clear-btn:hover {
    background: #fee2e2;
    color: #ef4444;
}

.aiedu-outline-search-info {
    font-size: 11px;
    color: #64748b;
    margin-top: 4px;
    padding: 0 2px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 16px;
}

.aiedu-outline-empty-match {
    padding: 24px 12px;
    text-align: center;
    color: #94a3b8;
    font-size: 12.5px;
    font-style: italic;
}

/* Search Highlights */
mark.aiedu-search-match {
    background-color: #fef08a !important;
    color: #0f172a !important;
    padding: 1px 3px;
    border-radius: 3px;
    box-shadow: 0 0 0 1px #eab308;
    transition: all 0.15s ease;
}

mark.aiedu-search-match.aiedu-search-active {
    background-color: #f97316 !important;
    color: #ffffff !important;
    box-shadow: 0 0 0 2px #c2410c, 0 0 10px rgba(249, 115, 22, 0.7) !important;
    font-weight: 700;
}

/* Outline Search Match Indicator */
.aiedu-tree-node.aiedu-outline-has-match,
.aiedu-outline-item.aiedu-outline-has-match {
    background: #fef9c3 !important;
    color: #854d0e !important;
    font-weight: 600 !important;
    border-left: 3px solid #eab308 !important;
}

.aiedu-outline-match-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    background: #eab308;
    color: #ffffff;
    border-radius: 10px;
    padding: 0 5px;
    height: 16px;
    min-width: 16px;
    flex-shrink: 0;
}

/* Shared Font Controls */
.aiedu-font-controls {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 2px 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.aiedu-font-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #334155;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    line-height: 1.2;
    transition: all 0.15s ease;
    user-select: none;
}

.aiedu-font-btn:hover {
    background: #e2e8f0;
    color: #1e293b;
    border-color: #cbd5e1;
}

.aiedu-font-display {
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    padding: 0 4px;
    min-width: 32px;
    text-align: center;
    cursor: pointer;
    user-select: none;
}

/* ==========================================================================
   Subfolder Tree Section (Sidebar)
   ========================================================================== */
.aiedu-folder-section {
    padding: 8px 12px;
    border-bottom: 1px solid #e2e8f0;
    background: #fafafa;
}

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

.aiedu-folder-title {
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.aiedu-btn-folder-add {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 7px;
    font-size: 11px;
    font-weight: 600;
    color: #4338ca;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.aiedu-btn-folder-add:hover {
    background: #e0e7ff;
    color: #3730a3;
}

.aiedu-folder-tree {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 200px;
    overflow-y: auto;
}

.aiedu-folder-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #334155;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.aiedu-folder-item:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.aiedu-folder-item.active {
    background: #e0e7ff;
    color: #3730a3;
    font-weight: 600;
}

.aiedu-folder-item-left {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.aiedu-folder-item-right {
    display: flex;
    align-items: center;
    gap: 4px;
}

.aiedu-folder-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    background: #e2e8f0;
    color: #475569;
}

.aiedu-folder-item.active .aiedu-folder-badge {
    background: #c7d2fe;
    color: #3730a3;
}

.aiedu-folder-actions {
    display: none;
    align-items: center;
    gap: 2px;
}

.aiedu-folder-item:hover .aiedu-folder-actions {
    display: flex;
}

.aiedu-folder-action-btn {
    background: transparent;
    border: none;
    font-size: 11px;
    color: #64748b;
    cursor: pointer;
    padding: 1px 4px;
    border-radius: 3px;
    line-height: 1;
}

.aiedu-folder-action-btn:hover {
    color: #0f172a;
    background: #cbd5e1;
}

.aiedu-folder-action-btn.delete:hover {
    color: #dc2626;
    background: #fee2e2;
}

/* Drag and Drop Folder Reordering */
.aiedu-folder-drag-handle {
    cursor: grab;
    color: #94a3b8;
    font-size: 13px;
    line-height: 1;
    padding: 0 2px;
    letter-spacing: -1px;
    user-select: none;
    opacity: 0.6;
    transition: opacity 0.15s ease, color 0.15s ease;
}

.aiedu-folder-item:hover .aiedu-folder-drag-handle {
    opacity: 1;
    color: #475569;
}

.aiedu-folder-item[draggable="true"] {
    cursor: grab;
}

.aiedu-folder-item.is-dragging {
    opacity: 0.35;
    border: 1px dashed #6366f1;
    background: #eef2ff !important;
    cursor: grabbing !important;
}

.aiedu-folder-item.drag-over-top {
    border-top: 2px solid #4f46e5 !important;
    border-radius: 4px 4px 0 0;
}

.aiedu-folder-item.drag-over-bottom {
    border-bottom: 2px solid #4f46e5 !important;
    border-radius: 0 0 4px 4px;
}

/* Toast notification for folder operations */
.aiedu-folder-section {
    position: relative;
}

.aiedu-folder-toast {
    position: absolute;
    bottom: 6px;
    left: 8px;
    right: 8px;
    background: #0f172a;
    color: #f8fafc;
    padding: 5px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    z-index: 20;
    display: none;
}

.aiedu-folder-toast.success {
    background: #065f46;
    color: #ecfdf5;
}

.aiedu-folder-toast.error {
    background: #991b1b;
    color: #fef2f2;
}

/* Document Card Folder Tag */
.aiedu-card-sub-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
    gap: 6px;
}

.aiedu-folder-tag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    background: #f1f5f9;
    color: #475569;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.aiedu-doc-card-folder-btn {
    background: transparent;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 10px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s ease;
}

.aiedu-doc-card-folder-btn:hover {
    background: #e2e8f0;
    color: #1e293b;
}

/* Guest / Locked Tab State */
.aiedu-tab-locked-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    background: #f8fafc;
    min-height: 480px;
    width: 100%;
}

.aiedu-tab-locked-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 40px 36px;
    max-width: 540px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.aiedu-tab-locked-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: #eff6ff;
    color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 8px rgba(37, 99, 235, 0.08);
}

.aiedu-tab-locked-title {
    font-size: 19px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 12px;
    line-height: 1.4;
}

.aiedu-tab-locked-desc {
    font-size: 14px;
    color: #64748b;
    line-height: 1.6;
    margin: 0 0 28px;
    text-align: center;
}

.aiedu-tab-locked-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.aiedu-tab-locked-actions .aiedu-btn {
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
}

/* ==========================================================================
   Comprehensive Mobile & Tablet Responsive Architecture (< 900px, < 768px, < 480px)
   Complies with Touch Ergonomics, Fluid Viewport, and Stacked Splitter Flow
   ========================================================================== */

@media (max-width: 900px) {
    .aiedu-workspace-layout {
        height: auto !important;
        min-height: unset !important;
    }

    .aiedu-ai-split-view {
        flex-direction: column !important;
        height: auto !important;
    }

    .aiedu-ai-chat-column {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 100% !important;
        height: 540px !important;
        border-right: none !important;
        border-bottom: 2px solid #e2e8f0 !important;
    }

    .aiedu-resizer.aiedu-resizer-draft-right {
        display: none !important;
    }

    .aiedu-ai-draft-column {
        width: 100% !important;
        min-width: 100% !important;
        overflow-x: auto !important;
    }
}

@media (max-width: 768px) {
    /* 1. Global App Layout: Stack from horizontal 30:70 to natural vertical flow */
    .aiedu-doc-reader-root {
        padding: 0 !important;
        margin: 0 !important;
    }

    .aiedu-workspace-layout {
        flex-direction: column !important;
        height: auto !important;
        min-height: unset !important;
        border-radius: 8px !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
        overflow: visible !important;
    }

    /* 2. Resizers: Mouse draggable dividers are hidden on touch screens */
    .aiedu-resizer,
    .aiedu-resizer-main,
    .aiedu-resizer-read,
    .aiedu-resizer-draft-right {
        display: none !important;
    }

    /* 3. Left Control Sidebar: Full width on mobile */
    .aiedu-sidebar-pane {
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        max-height: 440px !important;
        border-right: none !important;
        border-bottom: 2px solid #e2e8f0 !important;
    }

    .aiedu-sidebar-header {
        padding: 12px 14px !important;
    }

    /* 4. Luxury 3D Tabs Touch Ergonomics: Smooth horizontal touch scroll with 42px finger target */
    .aiedu-system-tabs {
        margin: 8px 10px 6px !important;
        padding: 4px 6px !important;
        gap: 6px !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        justify-content: flex-start !important;
    }

    .aiedu-sys-tab {
        flex: 0 0 auto !important;
        min-height: 42px !important;
        height: 42px !important;
        padding: 0 14px !important;
        font-size: 12.5px !important;
        border-radius: 8px !important;
    }

    .aiedu-workspace-tabs {
        padding: 8px 10px !important;
        gap: 6px !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        justify-content: flex-start !important;
    }

    .aiedu-ws-tab {
        flex: 0 0 auto !important;
        min-height: 42px !important;
        height: 42px !important;
        padding: 0 16px !important;
        font-size: 13px !important;
        border-radius: 8px !important;
    }

    /* 5. Main Content Pane */
    .aiedu-main-pane {
        width: 100% !important;
        min-width: 100% !important;
        height: auto !important;
        min-height: 600px !important;
        overflow: visible !important;
    }

    .aiedu-doc-header {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
        padding: 14px !important;
    }

    .aiedu-view-title {
        font-size: 16px !important;
        line-height: 1.4 !important;
    }

    .aiedu-view-meta-row {
        flex-wrap: wrap !important;
        gap: 8px 14px !important;
    }

    .aiedu-doc-actions {
        width: 100% !important;
        flex-wrap: wrap !important;
        justify-content: flex-start !important;
        gap: 8px !important;
    }

    /* 6. Read View: Stack Outline & Chunks Stream */
    .aiedu-read-container {
        flex-direction: column !important;
        height: auto !important;
        overflow: visible !important;
    }

    .aiedu-outline-explorer {
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        max-height: 240px !important;
        border-right: none !important;
        border-bottom: 1px solid #e2e8f0 !important;
    }

    .aiedu-chunks-stream-wrapper {
        width: 100% !important;
        min-width: 100% !important;
        height: 600px !important;
        max-height: 80vh !important;
    }

    /* 7. AI View on Mobile */
    .aiedu-ai-chat-column {
        height: 480px !important;
        max-height: 80vh !important;
    }

    .aiedu-ai-mode-selector {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 8px !important;
    }

    .aiedu-mode-radios {
        gap: 10px !important;
    }

    .aiedu-chat-input-form {
        padding: 10px 12px !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 8px !important;
    }

    .aiedu-chat-input-form textarea {
        height: 80px !important;
        min-height: 80px !important;
        font-size: 13px !important;
    }

    .aiedu-chat-actions-col {
        width: 100% !important;
        height: auto !important;
        flex-direction: row-reverse !important;
        gap: 8px !important;
    }

    .aiedu-chat-actions-col #aiedu_send_query_btn,
    .aiedu-prompt-select-wrap {
        flex: 1 !important;
        width: auto !important;
    }

    /* 8. A4 Drafting Canvas Page on Mobile */
    .aiedu-a4-page {
        width: 100% !important;
        min-width: unset !important;
        max-width: 100% !important;
        margin: 10px auto !important;
        padding: 20px 14px !important;
        box-sizing: border-box !important;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08) !important;
    }

    .aiedu-doc-sign-wrapper {
        flex-direction: column !important;
        gap: 16px !important;
    }

    .aiedu-doc-sign-right,
    .aiedu-doc-sign-left {
        width: 100% !important;
        text-align: left !important;
    }
}

@media (max-width: 480px) {
    /* Micro Screen Fine-Tuning (iPhone SE, Small Android Phones) */
    .aiedu-brand-title h2 {
        font-size: 14px !important;
    }

    .aiedu-sys-tab {
        min-height: 40px !important;
        height: 40px !important;
        padding: 0 10px !important;
        font-size: 11.5px !important;
        gap: 4px !important;
    }

    .aiedu-tab-badge {
        font-size: 8.5px !important;
        padding: 1px 4px !important;
    }

    .aiedu-ws-tab {
        min-height: 40px !important;
        height: 40px !important;
        padding: 0 12px !important;
        font-size: 12px !important;
    }

    .aiedu-chat-msg {
        max-width: 95% !important;
    }

    .aiedu-msg-bubble {
        padding: 10px 12px !important;
        font-size: 12.5px !important;
    }

    .aiedu-a4-page table {
        display: block !important;
        overflow-x: auto !important;
        max-width: 100% !important;
    }

    .aiedu-modal-card {
        width: 95% !important;
        padding: 16px !important;
    }
}

/* ==========================================================================
   Password Wrapper & Toggle Visibility Button (v1.4.6)
   ========================================================================== */
.aiedu-password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.aiedu-password-wrapper .aiedu-form-control {
    width: 100%;
    padding-right: 36px !important;
}

.aiedu-toggle-password-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    padding: 4px;
    margin: 0;
    cursor: pointer;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: color 0.15s ease, background-color 0.15s ease;
    z-index: 2;
}

.aiedu-toggle-password-btn:hover {
    color: #0f172a;
    background-color: #f1f5f9;
}

.aiedu-toggle-password-btn:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 1px;
}

.aiedu-ai-model-select {
    flex-shrink: 0;
}

/* ============================
   Party Document (Mau VND) Tables - A4 Canvas
   ============================ */
.aiedu-borderless-tbl,
.aiedu-party-header-tbl,
.aiedu-party-footer-tbl {
    width: 100%;
    border: none !important;
    border-collapse: collapse !important;
    border-spacing: 0 !important;
    margin: 0;
    padding: 0;
}

.aiedu-borderless-tbl td,
.aiedu-party-header-tbl td,
.aiedu-party-footer-tbl td {
    border: none !important;
    padding: 2px 4px;
    vertical-align: top;
    line-height: 1.45;
    font-size: 13pt;
}

/* Header table: left col ~44%, right col ~56% */
.aiedu-party-header-tbl td:first-child {
    width: 44%;
    text-align: center;
}

.aiedu-party-header-tbl td:last-child {
    width: 56%;
    text-align: center;
}

/* Footer table: left col Noi nhan ~50%, right col Ky ten ~50% */
.aiedu-party-footer-tbl td:first-child {
    width: 50%;
    vertical-align: top;
    font-size: 11pt;
}

.aiedu-party-footer-tbl td:last-child {
    width: 50%;
    text-align: center;
    vertical-align: top;
}

/* Party document body text style on A4 canvas */
.aiedu-party-body-content {
    text-align: justify;
    text-indent: 1.27cm;
    line-height: 1.45;
    font-size: 14pt;
}

.aiedu-party-body-content p {
    text-indent: 1.27cm;
    margin: 0 0 4px 0;
}

/* Title & Trich yeu */
.aiedu-party-title {
    text-align: center;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 15pt;
    margin: 12px 0 4px 0;
}

.aiedu-party-trich-yeu {
    text-align: center;
    font-weight: bold;
    font-size: 13.5pt;
    margin: 0 0 12px 0;
}
