@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ==========================================================================
   RisetPilot - Ultra-Premium Academic SaaS Design System
   High-end Polish, Glassmorphism, Micro-Interactions
   ========================================================================== */

:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    --primary-glow: rgba(37, 99, 235, 0.25);
    --primary-dark: #1e3a8a;
    
    --bg-main: #f8fafc;
    --bg-surface: #ffffff;
    --bg-sidebar: #0b1329;
    --border-sidebar: #1e293b;
    --sidebar-text: #94a3b8;
    
    --border-color: #e2e8f0;
    --border-subtle: #f1f5f9;
    --border-focus: rgba(37, 99, 235, 0.4);
    
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    
    --color-purple-bg: #f5f3ff;
    --color-purple-text: #7c3aed;
    --color-green-bg: #ecfdf5;
    --color-green-text: #059669;
    --color-blue-bg: #eff6ff;
    --color-blue-text: #2563eb;
    --color-orange-bg: #fff7ed;
    --color-orange-text: #ea580c;
    --color-amber-bg: #fef3c7;
    --color-amber-text: #d97706;
    --color-red-bg: #fef2f2;
    --color-red-text: #dc2626;

    --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px 0 rgba(15, 23, 42, 0.06), 0 1px 2px -1px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 12px -2px rgba(15, 23, 42, 0.06), 0 2px 6px -2px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 12px 24px -4px rgba(15, 23, 42, 0.08), 0 4px 8px -4px rgba(15, 23, 42, 0.04);
    --shadow-xl: 0 20px 32px -6px rgba(15, 23, 42, 0.12), 0 8px 16px -6px rgba(15, 23, 42, 0.06);
    --shadow-primary: 0 8px 20px -4px rgba(37, 99, 235, 0.35);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --radius-2xl: 22px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    overflow-x: clip;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.15s ease;
}

/* App Container - Fixed Viewport SaaS Layout */
.app-wrapper {
    display: flex;
    height: 100%;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    width: 100%;
    max-width: 100vw;
    overflow: hidden;
    position: relative;
}

/* Sidebar Styling - Ultra-Premium SaaS (Differentiated Dark Slate Navy Theme) */
.app-sidebar {
    width: 270px;
    min-width: 270px;
    max-width: 270px;
    background: linear-gradient(180deg, #0b1329 0%, #0d1630 60%, #090e1f 100%);
    border-right: 1px solid #1e293b;
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    z-index: 40;
    flex-shrink: 0;
    box-sizing: border-box;
    transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1), min-width 0.25s cubic-bezier(0.4, 0, 0.2, 1), max-width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 2px 0 16px rgba(0, 0, 0, 0.25);
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.sidebar-brand-wrapper {
    padding: 18px 18px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(11, 19, 41, 0.85);
    backdrop-filter: blur(10px);
    gap: 8px;
    flex-shrink: 0;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
    text-decoration: none;
}

.brand-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
    color: #fff;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.35);
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.brand-title {
    font-size: 19px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.5px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.brand-badge {
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(37, 99, 235, 0.25);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.4);
}

.btn-sidebar-arrow {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-sidebar-arrow:hover {
    background: rgba(37, 99, 235, 0.25);
    color: #ffffff;
    border-color: #3b82f6;
    transform: scale(1.05);
}

.sidebar-nav {
    padding: 12px 10px;
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 9999px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.22);
}

.sidebar-section-title {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #64748b;
    padding: 14px 10px 4px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8.5px 12px;
    color: #94a3b8;
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    text-decoration: none;
    position: relative;
    margin: 1.5px 0;
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.07);
    color: #ffffff;
    transform: translateX(2px);
}

.nav-item.active {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    font-weight: 700;
    border-left: none;
    padding-left: 12px;
    box-shadow: 0 4px 14px -2px rgba(37, 99, 235, 0.55);
}

.nav-icon-wrap {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: transparent;
    color: #64748b;
    transition: all 0.18s ease;
}

.nav-item:hover .nav-icon-wrap {
    background: rgba(37, 99, 235, 0.18);
    color: #60a5fa;
    transform: scale(1.05);
}

.nav-item.active .nav-icon-wrap {
    background: rgba(255, 255, 255, 0.22);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.nav-icon-wrap svg {
    width: 16px;
    height: 16px;
    stroke-width: 2;
}

.nav-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity 0.2s ease;
    flex: 1;
    min-width: 0;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: -0.15px;
}

.nav-badge {
    font-size: 9.5px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.08);
    color: #94a3b8;
    border: 1px solid rgba(255, 255, 255, 0.06);
    margin-left: auto;
    letter-spacing: 0.2px;
    transition: all 0.18s;
    flex-shrink: 0;
    font-family: var(--font-mono), 'Plus Jakarta Sans', monospace;
}

.nav-item:hover .nav-badge {
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
}

.nav-item.active .nav-badge {
    background: rgba(255, 255, 255, 0.22);
    color: #ffffff;
    font-weight: 800;
    border-color: rgba(255, 255, 255, 0.3);
}

.sidebar-footer {
    padding: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
    background: rgba(9, 14, 29, 0.95);
}

.pro-banner {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: 11px 12px;
    position: relative;
    transition: all 0.2s;
    box-shadow: 0 8px 20px -4px rgba(15, 23, 42, 0.25);
    color: #ffffff;
}

.pro-banner-title {
    font-size: 12px;
    font-weight: 700;
    color: #fde68a;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 3px;
}

.pro-banner-desc {
    font-size: 11px;
    color: #94a3b8;
    margin-bottom: 10px;
    line-height: 1.4;
}

.btn-pro {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 7px 10px;
    text-align: center;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border-radius: var(--radius-sm);
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

.btn-pro:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.45);
}

/* ==========================================================================
   Zero-Shift Instant Collapsed State (Anti-Flicker on Navigation)
   ========================================================================== */
html.sidebar-is-collapsed .app-sidebar {
    width: 72px !important;
    min-width: 72px !important;
    max-width: 72px !important;
    transition: none !important;
}

html.sidebar-is-collapsed .app-sidebar .brand-title-wrap,
html.sidebar-is-collapsed .app-sidebar .nav-label,
html.sidebar-is-collapsed .app-sidebar .nav-badge,
html.sidebar-is-collapsed .app-sidebar .pro-banner-desc,
html.sidebar-is-collapsed .app-sidebar .pro-banner-title {
    display: none !important;
}

.app-sidebar.no-transition,
.app-sidebar.no-transition * {
    transition: none !important;
}

/* ==========================================================================
   Collapsed Sidebar State (Ultra-Sleek SaaS)
   ========================================================================== */
.app-sidebar.collapsed {
    width: 72px;
    min-width: 72px;
    max-width: 72px;
    overflow-x: visible;
}

.app-sidebar.collapsed .brand-title-wrap,
.app-sidebar.collapsed .nav-label,
.app-sidebar.collapsed .nav-badge,
.app-sidebar.collapsed .pro-banner-desc,
.app-sidebar.collapsed .pro-banner-title {
    display: none !important;
}

.app-sidebar.collapsed .sidebar-section-title {
    display: block !important;
    width: 28px;
    height: 1px;
    background: rgba(255, 255, 255, 0.12);
    margin: 8px auto 4px auto;
    padding: 0 !important;
    font-size: 0 !important;
    line-height: 0 !important;
    color: transparent !important;
    border: none !important;
    overflow: hidden;
}

.app-sidebar.collapsed .sidebar-nav > .sidebar-section-title:first-child {
    display: none !important;
}

.app-sidebar.collapsed .sidebar-brand-wrapper {
    padding: 16px 0;
    justify-content: center;
    position: relative;
}

.app-sidebar.collapsed .sidebar-brand {
    gap: 0;
    justify-content: center;
    position: relative;
}

.app-sidebar.collapsed .btn-sidebar-arrow {
    display: none !important;
}

.app-sidebar.collapsed .sidebar-nav {
    padding: 10px 0;
    align-items: center;
    overflow-x: visible;
}

.app-sidebar.collapsed .nav-item {
    width: 44px;
    height: 44px;
    margin: 3px auto;
    margin: 4px auto;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    border-radius: 12px;
    border-left: none !important;
    background: transparent;
    position: relative;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    outline: none;
}

.app-sidebar.collapsed .nav-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: none;
    transform: translateY(-1px);
}

.app-sidebar.collapsed .nav-item:active,
.app-sidebar.collapsed .nav-item.nav-item-pressed {
    transform: scale(0.93);
    transition: transform 0.08s ease;
}

.app-sidebar.collapsed .nav-item.active {
    background: rgba(37, 99, 235, 0.2);
    background: rgba(37, 99, 235, 0.22);
    border-left: none !important;
    padding: 0 !important;
    box-shadow: 0 0 0 1.5px rgba(59, 130, 246, 0.4);
    box-shadow: 0 0 0 1.5px rgba(59, 130, 246, 0.45), 0 4px 12px rgba(37, 99, 235, 0.2);
}

.app-sidebar.collapsed .nav-item .nav-icon-wrap {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    color: #94a3b8;
    margin: 0;
    transition: all 0.2s ease;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.app-sidebar.collapsed .nav-item:hover .nav-icon-wrap {
    color: var(--primary);
    background: transparent;
    transform: scale(1.08);
    color: #60a5fa;
    background: rgba(255, 255, 255, 0.05);
    transform: scale(1.05);
}

.app-sidebar.collapsed .nav-item.active .nav-icon-wrap {
    background: var(--primary);
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.45);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.5);
    transform: scale(1.02);
}

.app-sidebar.collapsed .nav-icon-wrap svg,
.app-sidebar.collapsed .nav-item .nav-icon-wrap svg {
    width: 20px !important;
    height: 20px !important;
    stroke-width: 2 !important;
    display: block !important;
}

/* Sidebar Bottom Toggle Button (Expanded & Collapsed) */
.btn-sidebar-bottom-toggle {
    margin-top: 10px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: #94a3b8;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-sidebar-bottom-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.18);
}

.btn-sidebar-bottom-toggle .icon-toggle-arrow {
    transition: transform 0.2s;
}

/* Collapsed Pro / BYOK Footer */
.app-sidebar.collapsed .sidebar-footer {
    padding: 12px 0 16px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-top: 1px solid var(--border-color);
    gap: 8px;
}

.app-sidebar.collapsed .pro-banner {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 auto !important;
    width: 44px !important;
    height: 44px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.app-sidebar.collapsed .btn-pro {
    width: 44px !important;
    height: 44px !important;
    padding: 0 !important;
    margin: 0 auto !important;
    border-radius: 11px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 18px !important;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%) !important;
    color: #fbbf24 !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.3) !important;
    cursor: pointer !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative !important;
}

.app-sidebar.collapsed .btn-pro:hover {
    transform: scale(1.06) !important;
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.35) !important;
    border-color: #f59e0b !important;
    color: #fde68a !important;
}

.app-sidebar.collapsed .btn-pro span:last-child {
    display: none !important;
}

.app-sidebar.collapsed .btn-sidebar-bottom-toggle {
    width: 44px !important;
    height: 34px !important;
    margin: 4px auto 0 auto !important;
    padding: 0 !important;
    border-radius: 9px !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    background: rgba(255, 255, 255, 0.04) !important;
    color: #94a3b8 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    position: relative !important;
    transition: all 0.2s !important;
}

.app-sidebar.collapsed .btn-sidebar-bottom-toggle:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

.app-sidebar.collapsed .btn-sidebar-bottom-toggle .toggle-text {
    display: none !important;
}

.app-sidebar.collapsed .btn-sidebar-bottom-toggle .icon-toggle-arrow {
    transform: rotate(180deg) !important;
}

/* Floating Tooltip with Arrow on Collapsed Sidebar */
.app-sidebar.collapsed .nav-item:hover::before,
.app-sidebar.collapsed .btn-pro:hover::before,
.app-sidebar.collapsed .btn-sidebar-bottom-toggle:hover::before,
.app-sidebar.collapsed .sidebar-brand:hover::before {
    content: "";
    position: absolute;
    left: 48px;
    left: 50px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 5px 6px 5px 0;
    border-style: solid;
    border-color: transparent #0f172a transparent transparent;
    z-index: 10000;
    pointer-events: none;
    opacity: 0;
    animation: rpTooltipArrowFade 0.18s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.app-sidebar.collapsed .nav-item:hover::after,
.app-sidebar.collapsed .btn-pro:hover::after,
.app-sidebar.collapsed .btn-sidebar-bottom-toggle:hover::after,
.app-sidebar.collapsed .sidebar-brand:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 54px;
    left: 56px;
    top: 50%;
    transform: translateY(-50%);
    background: #0f172a;
    color: #ffffff;
    color: #f8fafc;
    padding: 6px 12px;
    border-radius: 7px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    z-index: 9999;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.1);
    pointer-events: none;
    line-height: 1.4;
    animation: rpTooltipFade 0.15s ease forwards;
    opacity: 0;
    animation: rpTooltipFade 0.18s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes rpTooltipFade {
    from {
        opacity: 0;
        transform: translateY(-50%) translateX(-6px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(-50%) translateX(0) scale(1);
    }
}

@keyframes rpTooltipArrowFade {
    from {
        opacity: 0;
        transform: translateY(-50%) translateX(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(-50%) translateX(0);
    }
}

.btn-topbar-toggle {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s;
    margin-right: 12px;
}

.btn-topbar-toggle:hover {
    background-color: #f1f5f9;
    color: var(--primary);
    border-color: var(--primary);
}

/* Main Content Area */
.app-main {
    flex: 1 1 auto;
    height: 100%;
    max-height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    min-width: 0;
    width: auto;
    max-width: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: #94a3b8 #f1f5f9;
}

.app-main::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.app-main::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.app-main::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 6px;
    border: 2px solid #f1f5f9;
}

.app-main::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.app-sidebar.collapsed + .app-main {
    width: auto;
}

/* Top Navbar - Glassmorphism */
.app-topbar {
    height: 66px;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.85);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 30;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    gap: 16px;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
    overflow: hidden;
}

.topbar-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
}

.topbar-breadcrumb-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.topbar-breadcrumb-sep {
    color: #cbd5e1;
    font-size: 11px;
}

.topbar-breadcrumb-current {
    font-weight: 700;
    color: #0f172a;
}

.topbar-project-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 12px;
    color: #334155;
    font-weight: 600;
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 1;
}

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

.topbar-ai-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
    border: 1px solid #bfdbfe;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 700;
    color: #1e40af;
    cursor: pointer;
    transition: all 0.2s;
}

.topbar-ai-chip:hover {
    background: #dbeafe;
    border-color: #93c5fd;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(37, 99, 235, 0.15);
}

@keyframes pulse-dot {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.6; }
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    display: inline-block;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
    animation: pulse-dot 2s infinite ease-in-out;
}

.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    border: 1px solid var(--border-color);
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    position: relative;
    transition: all 0.15s;
    font-size: 15px;
}

.btn-icon:hover {
    background-color: var(--bg-main);
    color: var(--text-main);
    border-color: #cbd5e1;
    transform: scale(1.05);
}

.notification-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 8px;
    height: 8px;
    background-color: #ef4444;
    border-radius: 50%;
    border: 2px solid #ffffff;
}

.user-pill {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 4px 12px 4px 5px;
    border: 1px solid var(--border-color);
    background: #ffffff;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.user-pill:hover {
    background-color: #f8fafc;
    border-color: #cbd5e1;
    box-shadow: var(--shadow-sm);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #6366f1);
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

/* Page Layout & Grid */
.page-container {
    padding: 20px 28px 100px 28px;
    max-width: 100%;
    margin: 0 auto;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    flex: 1 0 auto;
}

.page-container.page-container-wide {
    padding: 14px 20px 100px 20px;
}

.dashboard-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 24px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.main-column {
    min-width: 0;
    width: 100%;
    max-width: 100%;
}

.right-sidebar {
    min-width: 0;
    width: 100%;
    max-width: 100%;
}

/* Welcome Box & Stage Cards */
.welcome-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 24px 24px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

.welcome-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #2563eb, #8b5cf6, #3b82f6);
}

.welcome-header {
    margin-bottom: 20px;
}

.welcome-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
}

.welcome-greeting h1 {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-main);
    margin: 0 0 4px 0;
    letter-spacing: -0.4px;
}

.welcome-greeting p {
    font-size: 13.5px;
    color: var(--text-muted);
    margin: 0;
}

.stage-cards-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    width: 100%;
    min-width: 0;
}

.stage-card {
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px 12px 18px 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    background: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: visible;
    min-width: 0;
    box-sizing: border-box;
    word-break: break-word;
    height: 100%;
}

.stage-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.stage-step-tag {
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 6px;
    margin-bottom: 12px;
    background: #f1f5f9;
    color: #64748b;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.stage-card.purple .stage-step-tag { background: #f3e8ff; color: #7e22ce; }
.stage-card.green .stage-step-tag { background: #dcfce7; color: #15803d; }
.stage-card.blue .stage-step-tag { background: #dbeafe; color: #1d4ed8; }
.stage-card.orange .stage-step-tag { background: #ffedd5; color: #c2410c; }

.stage-card.purple:hover, .stage-card.purple.active { border-color: #8b5cf6; background: linear-gradient(180deg, #faf5ff 0%, #ffffff 100%); }
.stage-card.green:hover, .stage-card.green.active { border-color: #10b981; background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 100%); }
.stage-card.blue:hover, .stage-card.blue.active { border-color: #2563eb; background: linear-gradient(180deg, #eff6ff 0%, #ffffff 100%); }
.stage-card.orange:hover, .stage-card.orange.active { border-color: #f97316; background: linear-gradient(180deg, #fff7ed 0%, #ffffff 100%); }

.stage-card.active {
    border-width: 2px;
}

.stage-card.purple.active {
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2), var(--shadow-md);
}
.stage-card.green.active {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2), var(--shadow-md);
}
.stage-card.blue.active {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2), var(--shadow-md);
}
.stage-card.orange.active {
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.2), var(--shadow-md);
}

.stage-card.active .stage-step-tag {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    letter-spacing: 0.5px;
}

.stage-card.purple.active .stage-step-tag { background: #8b5cf6; color: #ffffff; }
.stage-card.green.active .stage-step-tag { background: #10b981; color: #ffffff; }
.stage-card.blue.active .stage-step-tag { background: #2563eb; color: #ffffff; }
.stage-card.orange.active .stage-step-tag { background: #ea580c; color: #ffffff; }

.stage-card.active .stage-step-tag::before {
    content: "✓ ";
    font-weight: 900;
}

.stage-card.active .stage-step-tag::after {
    content: " • DIPILIH";
    font-size: 8.5px;
    opacity: 0.92;
}

.stage-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    font-size: 22px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s ease;
}

.stage-card:hover .stage-icon {
    transform: scale(1.08);
}

.stage-card.purple .stage-icon { background: #f3e8ff; }
.stage-card.green .stage-icon { background: #dcfce7; }
.stage-card.blue .stage-icon { background: #dbeafe; }
.stage-card.orange .stage-icon { background: #ffedd5; }

.stage-title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 6px;
    line-height: 1.35;
}

.stage-desc {
    font-size: 11.5px;
    color: var(--text-muted);
    line-height: 1.45;
}

/* Active Project Hero Banner */
.active-project-hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 55%, #2563eb 100%);
    color: #ffffff;
    border-radius: var(--radius-xl);
    padding: 24px 28px;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: 0 12px 30px -6px rgba(30, 58, 138, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.12);
    position: relative;
    overflow: hidden;
}

.active-project-hero::after {
    content: "";
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.2) 0%, transparent 70%);
    pointer-events: none;
}

.hero-info {
    width: 100%;
    min-width: 0;
}

.hero-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
    width: 100%;
}

.hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #93c5fd;
    white-space: nowrap;
}

.active-project-hero .hero-title {
    font-size: 20px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.3px;
    margin-bottom: 10px;
    line-height: 1.35;
    word-break: break-word;
}

.hero-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 10px;
    margin-bottom: 18px;
}

.hero-meta-chip,
.hero-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #f1f5f9;
    white-space: nowrap;
    backdrop-filter: blur(4px);
    transition: all 0.2s ease;
}

.hero-meta-chip:hover,
.hero-meta span:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.hero-meta-step {
    background: rgba(56, 189, 248, 0.2) !important;
    border-color: rgba(56, 189, 248, 0.4) !important;
    color: #ffffff !important;
    font-weight: 600 !important;
}

.hero-progress-wrapper {
    width: 100%;
    max-width: 100%;
}

.hero-progress-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #93c5fd;
    font-weight: 600;
    margin-bottom: 7px;
}

.hero-progress-track {
    height: 9px;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 20px;
    overflow: hidden;
    position: relative;
}

.hero-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #38bdf8, #818cf8);
    border-radius: 20px;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.8);
    transition: width 0.4s ease;
}

.hero-actions-bar,
.hero-cta-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    width: 100%;
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    color: #1e3a8a;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.hero-cta:hover {
    background: #f8fafc;
    color: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.25);
}

.hero-cta-arrow {
    font-size: 13px;
    transition: transform 0.2s ease;
}

.hero-cta:hover .hero-cta-arrow {
    transform: translateX(3px);
}

@media (max-width: 640px) {
    .hero-actions-bar,
    .hero-cta-wrap {
        flex-direction: column;
        align-items: stretch;
    }
    .hero-actions-bar .hero-workspace-btn,
    .hero-actions-bar .hero-cta,
    .hero-cta-wrap .hero-workspace-btn,
    .hero-cta-wrap .hero-cta {
        justify-content: center;
        width: 100%;
        text-align: center;
    }
    .hero-header-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}


/* New Project Form Card */
.form-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 26px 28px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
    position: relative;
}

.form-card-title {
    font-size: 17px;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 4px;
    letter-spacing: -0.3px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-card-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.project-form-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.project-form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1.3fr auto;
    gap: 16px;
    align-items: flex-end;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-label {
    font-size: 12.5px;
    font-weight: 600;
    color: #334155;
}

.form-input, .form-select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 13.5px;
    background-color: #ffffff;
    color: var(--text-main);
    outline: none;
    transition: all 0.15s;
}

.form-input:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: var(--primary);
    color: #ffffff;
    padding: 10px 22px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: background 0.15s ease;
    white-space: nowrap;
    text-decoration: none;
}

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

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: #ffffff;
    color: #334155;
    padding: 10px 18px;
    font-size: 13.5px;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-secondary:hover {
    background-color: var(--bg-main);
    border-color: #cbd5e1;
}

/* Right Column Widgets */
.right-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.widget-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 22px;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

/* Widget 1: Peta Kerja 24 Jam - Soft Indigo Slate */
.widget-card-roadmap {
    background: linear-gradient(145deg, #f8fafc 0%, #f0f4ff 50%, #e0e7ff 100%);
    border: 1.5px solid #c7d2fe;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.08);
}

.widget-card-roadmap .widget-title {
    color: #1e1b4b;
    font-weight: 800;
}

.widget-card-roadmap .widget-subtitle {
    color: #4338ca;
    font-weight: 500;
}

.widget-card-roadmap .roadmap-timeline::before {
    background-color: #c7d2fe;
}

.widget-card-roadmap .roadmap-step-icon {
    background-color: #ffffff;
    border-color: #a5b4fc;
    color: #4338ca;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.widget-card-roadmap .roadmap-step.active .roadmap-step-icon {
    border-color: #4f46e5;
    background-color: #4f46e5;
    color: #ffffff;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.widget-card-roadmap .roadmap-step-name {
    color: #1e1b4b;
}

.widget-card-roadmap .roadmap-step-hours {
    color: #6366f1;
    font-weight: 600;
}

.widget-card-roadmap #btnToggleAll24Steps {
    background: #ffffff;
    border: 1.5px solid #c7d2fe;
    color: #4338ca;
    font-weight: 700;
    transition: all 0.15s ease;
}

.widget-card-roadmap #btnToggleAll24Steps:hover {
    background: #eef2ff;
    border-color: #818cf8;
}

/* Widget 2: E-Book Card - Warm Reading Parchment / Amber Cream */
.widget-card-ebook {
    background: linear-gradient(145deg, #fffbeb 0%, #fef3c7 60%, #fef9c3 100%);
    border: 1.5px solid #fde68a;
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.12);
}

.widget-card-ebook .ebook-widget-tag {
    color: #92400e;
    font-weight: 700;
}

.widget-card-ebook .ebook-widget-title {
    color: #78350f;
    font-weight: 800;
}

.widget-card-ebook .ebook-widget-desc {
    color: #854d0e;
    font-weight: 500;
}

.widget-card-ebook .btn-secondary {
    background: #ffffff;
    border: 1.5px solid #d97706;
    color: #92400e;
    font-weight: 700;
    transition: all 0.15s ease;
}

.widget-card-ebook .btn-secondary:hover {
    background: #fefce8;
    border-color: #b45309;
    color: #78350f;
}

.widget-card-ebook .btn-primary {
    background: #1e40af;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(30, 64, 175, 0.3);
}

.widget-card-ebook .btn-primary:hover {
    background: #1e3a8a;
}

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

.widget-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.widget-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 18px;
}

/* 24 Jam Stepper */
.roadmap-timeline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    padding: 10px 0;
}

.roadmap-timeline::before {
    content: "";
    position: absolute;
    top: 26px;
    left: 20px;
    right: 20px;
    height: 2px;
    background-color: #e2e8f0;
    z-index: 1;
}

.roadmap-step {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.roadmap-step-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background-color: #ffffff;
    border: 2px solid #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    margin-bottom: 6px;
    color: var(--text-muted);
}

.roadmap-step.active .roadmap-step-icon {
    border-color: var(--primary);
    background-color: var(--primary-light);
    color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.roadmap-step.completed .roadmap-step-icon {
    border-color: #10b981;
    background-color: #10b981;
    color: #ffffff;
}

.roadmap-step-name {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-main);
}

.roadmap-step-hours {
    font-size: 9.5px;
    color: var(--text-muted);
}

/* E-Book Promotion Widget */
.ebook-widget-content {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.ebook-cover {
    width: 90px;
    height: 125px;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    color: #ffffff;
    padding: 10px 8px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.ebook-cover::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 4px;
    background: rgba(255, 255, 255, 0.2);
}

.ebook-cover-badge {
    font-size: 7px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #60a5fa;
    font-weight: 700;
}

.ebook-cover-title {
    font-size: 9px;
    font-weight: 700;
    line-height: 1.2;
}

.ebook-cover-brand {
    font-size: 8px;
    font-weight: 600;
    color: #94a3b8;
}

.ebook-widget-meta {
    flex: 1;
}

.ebook-widget-tag {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.ebook-widget-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.3;
    margin-bottom: 6px;
}

.ebook-widget-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

.ebook-actions {
    display: flex;
    gap: 10px;
}

.ebook-actions .btn-secondary, .ebook-actions .btn-primary {
    flex: 1;
    padding: 8px 12px;
    font-size: 12px;
}

/* Bottom Feature Cards (3x2 Balanced Grid) */
.bottom-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.feature-link-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 60%, #eff6ff 100%);
    border: 1.5px solid #dbeafe;
    border-radius: var(--radius-xl);
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    color: inherit;
    position: relative;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.06);
}

.feature-link-card:hover {
    background: linear-gradient(135deg, #ffffff 0%, #eff6ff 50%, #dbeafe 100%);
    border-color: #93c5fd;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.16);
}

.feature-icon-box {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease;
}

.feature-link-card:hover .feature-icon-box {
    transform: scale(1.08);
}

.feature-content {
    flex: 1;
    min-width: 0;
    padding-right: 8px;
}

.feature-title {
    font-size: 13.5px;
    font-weight: 700;
    color: #1e3a8a;
    margin-bottom: 3px;
    line-height: 1.35;
}

.feature-desc {
    font-size: 11.5px;
    color: #475569;
    line-height: 1.45;
    margin: 0;
}

.feature-arrow {
    color: #3b82f6;
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    flex-shrink: 0;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    margin-left: auto;
}

.feature-link-card:hover .feature-arrow {
    color: #1d4ed8;
    transform: translateX(4px);
}

/* ==========================================================================
   Modals - Ultra-Premium SaaS Dialogs
   ========================================================================== */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    transition: all 0.2s ease;
}

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

.modal-box {
    background: #ffffff;
    border-radius: 20px;
    width: 100%;
    max-width: 520px;
    box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(226, 232, 240, 0.9);
    overflow: hidden;
    animation: modalPopPremium 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.modal-box::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3.5px;
    background: linear-gradient(90deg, #2563eb 0%, #8b5cf6 50%, #3b82f6 100%);
    z-index: 2;
}

/* AI Connection Wide Modal (Responsive 2-Column BYOK) */
.modal-box.modal-box-wide {
    max-width: 960px !important;
    width: 92vw !important;
    max-height: 90vh !important;
    display: flex !important;
    flex-direction: column !important;
    box-sizing: border-box !important;
}

.modal-box.modal-box-wide .modal-header {
    flex-shrink: 0 !important;
    padding: 16px 24px !important;
    border-bottom: 1px solid var(--border-subtle) !important;
    background: #ffffff;
    box-sizing: border-box !important;
}

.modal-box.modal-box-wide .modal-body {
    flex: 1 1 auto !important;
    overflow-y: auto !important;
    max-height: calc(90vh - 135px) !important;
    padding: 20px 24px !important;
    box-sizing: border-box !important;
}

.modal-box.modal-box-wide .modal-footer {
    flex-shrink: 0 !important;
    padding: 14px 24px !important;
    border-top: 1px solid var(--border-subtle) !important;
    background: #f8fafc;
    box-sizing: border-box !important;
}

.ai-modal-grid {
    display: grid !important;
    grid-template-columns: 1.12fr 0.88fr !important;
    gap: 22px !important;
    align-items: start !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.ai-modal-col-left {
    min-width: 0 !important;
    width: 100% !important;
}

.ai-modal-col-right {
    min-width: 0 !important;
    width: 100% !important;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px !important;
    padding: 16px !important;
    box-sizing: border-box !important;
}

@media (max-width: 820px) {
    .modal-box.modal-box-wide {
        max-width: 96vw !important;
        width: 96vw !important;
        max-height: 94vh !important;
    }
    .modal-box.modal-box-wide .modal-body {
        max-height: calc(94vh - 130px) !important;
        padding: 16px !important;
    }
    .ai-modal-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
}

@keyframes modalPopPremium {
    from {
        opacity: 0;
        transform: scale(0.94) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    padding: 22px 26px 18px 26px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    gap: 16px;
}

.modal-title {
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.4px;
    margin: 0;
}

.modal-badge-tag {
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: #2563eb;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-block;
    margin-bottom: 5px;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    font-size: 18px;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.18s ease;
    flex-shrink: 0;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    background: #fee2e2;
    color: #dc2626;
    border-color: #fecaca;
    transform: scale(1.06);
}

.modal-body {
    padding: 22px 26px;
}

.modal-desc {
    font-size: 13.5px;
    color: #64748b;
    line-height: 1.5;
    margin-bottom: 18px;
}

/* Subchoice Interactive Cards */
.subchoice-cards-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.subchoice-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 18px;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    text-align: left;
}

.subchoice-card:hover {
    border-color: #2563eb;
    background: linear-gradient(135deg, #ffffff 0%, #f8faff 100%);
    transform: translateY(-2px);
    box-shadow: 0 12px 28px -6px rgba(37, 99, 235, 0.14), 0 4px 10px -2px rgba(37, 99, 235, 0.06);
}

.subchoice-icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.subchoice-icon-blue {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #bfdbfe;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.12);
}

.subchoice-icon-emerald {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border: 1px solid #a7f3d0;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.12);
}

.subchoice-card:hover .subchoice-icon-wrap {
    transform: scale(1.08);
}

.subchoice-content {
    flex: 1;
    min-width: 0;
}

.subchoice-header-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
    gap: 8px;
}

.subchoice-title {
    font-size: 15px;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
    letter-spacing: -0.3px;
}

.subchoice-tag {
    font-size: 10.5px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 6px;
}

.tag-blue {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.tag-emerald {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.subchoice-text {
    font-size: 12.5px;
    color: #475569;
    line-height: 1.45;
    margin: 0 0 8px 0;
}

.subchoice-features {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.subchoice-pill {
    font-size: 11px;
    font-weight: 600;
    color: #334155;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 6px;
}

.subchoice-arrow {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f1f5f9;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.subchoice-card:hover .subchoice-arrow {
    background: #2563eb;
    color: #ffffff;
    transform: translateX(3px);
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.35);
}

.modal-footer-hint {
    padding: 14px 24px;
    background: #f8fafc;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: #64748b;
    line-height: 1.4;
}

.modal-footer-hint .hint-icon {
    font-size: 15px;
    flex-shrink: 0;
}

.modal-footer {
    padding: 16px 26px;
    background-color: var(--bg-main);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ==========================================================================
   Ultra-Premium Alert & Notification Dialog Pop-up (PRD SaaS Experience)
   ========================================================================== */
.modal-backdrop-premium {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.24s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.24s;
    box-sizing: border-box;
}

.modal-backdrop-premium.active {
    opacity: 1;
    visibility: visible;
}

.premium-alert-card {
    background: #ffffff;
    width: 100%;
    max-width: 440px;
    border-radius: 24px;
    box-shadow: 0 25px 60px -12px rgba(15, 23, 42, 0.35), 0 0 0 1px rgba(226, 232, 240, 0.85);
    position: relative;
    overflow: hidden;
    padding: 32px 28px 24px 28px;
    text-align: center;
    transform: scale(0.9) translateY(16px);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
}

.modal-backdrop-premium.active .premium-alert-card {
    transform: scale(1) translateY(0);
}

.premium-alert-accent {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #2563eb 0%, #8b5cf6 50%, #3b82f6 100%);
    z-index: 3;
}

.premium-alert-accent.type-success {
    background: linear-gradient(90deg, #10b981 0%, #059669 50%, #34d399 100%);
}
.premium-alert-accent.type-warning {
    background: linear-gradient(90deg, #f59e0b 0%, #d97706 50%, #fbbf24 100%);
}
.premium-alert-accent.type-error {
    background: linear-gradient(90deg, #ef4444 0%, #dc2626 50%, #f87171 100%);
}
.premium-alert-accent.type-info,
.premium-alert-accent.type-primary {
    background: linear-gradient(90deg, #2563eb 0%, #8b5cf6 50%, #3b82f6 100%);
}

.premium-alert-close {
    position: absolute;
    top: 14px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #f1f5f9;
    color: #64748b;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.16s ease;
    z-index: 10;
    padding: 0;
}

.premium-alert-close:hover {
    background: #e2e8f0;
    color: #0f172a;
    transform: scale(1.08);
}

.premium-alert-icon-wrap {
    width: 72px;
    height: 72px;
    margin: 0 auto 18px auto;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.premium-alert-icon-halo {
    position: absolute;
    inset: -4px;
    border-radius: 26px;
    opacity: 0.35;
    filter: blur(10px);
    transition: background 0.3s ease;
}

.premium-alert-icon-wrap.type-success .premium-alert-icon-halo { background: #10b981; }
.premium-alert-icon-wrap.type-info .premium-alert-icon-halo,
.premium-alert-icon-wrap.type-primary .premium-alert-icon-halo { background: #3b82f6; }
.premium-alert-icon-wrap.type-warning .premium-alert-icon-halo { background: #f59e0b; }
.premium-alert-icon-wrap.type-error .premium-alert-icon-halo { background: #ef4444; }

.premium-alert-icon {
    width: 68px;
    height: 68px;
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    position: relative;
    z-index: 2;
    transition: all 0.25s ease;
}

.premium-alert-icon-wrap.type-success .premium-alert-icon {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border: 2px solid #a7f3d0;
    color: #059669;
    box-shadow: 0 8px 20px -4px rgba(16, 185, 129, 0.3);
}

.premium-alert-icon-wrap.type-info .premium-alert-icon,
.premium-alert-icon-wrap.type-primary .premium-alert-icon {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 2px solid #bfdbfe;
    color: #2563eb;
    box-shadow: 0 8px 20px -4px rgba(37, 99, 235, 0.3);
}

.premium-alert-icon-wrap.type-warning .premium-alert-icon {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 2px solid #fde68a;
    color: #d97706;
    box-shadow: 0 8px 20px -4px rgba(245, 158, 11, 0.3);
}

.premium-alert-icon-wrap.type-error .premium-alert-icon {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border: 2px solid #fecaca;
    color: #dc2626;
    box-shadow: 0 8px 20px -4px rgba(239, 68, 68, 0.3);
}

.premium-alert-title {
    font-size: 19px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.02em;
    margin: 0 0 8px 0;
    line-height: 1.35;
}

.premium-alert-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin-bottom: 12px;
}

.premium-alert-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
}

.premium-alert-tag.tag-primary {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.premium-alert-tag.tag-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.premium-alert-tag.tag-warning {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

.premium-alert-tag.tag-danger {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.premium-alert-message {
    font-size: 13.5px;
    color: #475569;
    line-height: 1.6;
    margin: 0 0 16px 0;
    word-break: break-word;
}

.premium-alert-details {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 12px;
    color: #334155;
    line-height: 1.5;
    text-align: left;
    margin-bottom: 18px;
}

.premium-alert-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
    margin-top: 6px;
}

.premium-alert-btn {
    padding: 12px 22px;
    border-radius: 12px;
    font-size: 13.5px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.18s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-sizing: border-box;
    text-decoration: none;
    font-family: inherit;
}

.premium-alert-btn-primary {
    flex: 1;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.premium-alert-btn-primary:hover {
    box-shadow: 0 8px 22px rgba(37, 99, 235, 0.45);
    transform: translateY(-1.5px);
}

.premium-alert-btn-primary:active {
    transform: translateY(0);
}

.premium-alert-btn-cancel {
    flex: 0 0 auto;
    background: #ffffff;
    color: #64748b;
    border: 1px solid #e2e8f0;
    font-weight: 600;
    padding: 12px 18px;
}

.premium-alert-btn-cancel:hover {
    background: #f8fafc;
    color: #0f172a;
    border-color: #cbd5e1;
}

/* Badges & Chips */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 20px;
}

.badge-tetap { background-color: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.badge-sementara { background-color: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.badge-konsultasi { background-color: #fffbeb; color: #b45309; border: 1px solid #fde68a; }

.badge-merah { background-color: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.badge-kuning { background-color: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.badge-hijau { background-color: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 13.5px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-success { background-color: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-error { background-color: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background-color: #fffbeb; color: #92400e; border: 1px solid #fde68a; }

/* Chapter Builder Header & Navigation */
.chapter-builder-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 16px;
    padding: 16px 22px;
    box-shadow: 0 4px 14px -3px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.02);
}

.builder-header-info {
    flex: 1;
    min-width: 280px;
}

.builder-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.builder-title {
    font-size: 22px;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
    letter-spacing: -0.4px;
}

.builder-subtitle {
    font-size: 13px;
    color: #64748b;
    line-height: 1.5;
    margin: 0;
    max-width: 680px;
}

.builder-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

/* Workspace View Controls (Perlebar Editor & Mode Fokus) */
.workspace-view-controls {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: #ffffff;
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    padding: 3px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    flex-shrink: 0;
    position: relative;
    z-index: 5;
    pointer-events: auto;
}

.btn-workspace-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 11px;
    font-size: 11.5px;
    font-weight: 600;
    color: #475569;
    background: transparent;
    border: none;
    border-radius: 7px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
    user-select: none;
    pointer-events: auto;
}

.btn-workspace-toggle:active {
    transform: scale(0.96);
}

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

.btn-workspace-toggle.active {
    background: #1e40af;
    color: #ffffff !important;
    box-shadow: 0 2px 5px rgba(30, 64, 175, 0.25);
}

.btn-workspace-toggle.collapsed {
    color: #94a3b8;
    background: #f8fafc;
}

.btn-workspace-toggle svg,
.btn-workspace-toggle span,
.btn-copilot-pill svg,
.btn-copilot-pill span {
    pointer-events: none;
}

.btn-copilot-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    font-size: 11.5px;
    font-weight: 700;
    color: #1d4ed8;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 9999px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.btn-copilot-pill:hover {
    background: #dbeafe;
    transform: translateY(-1px);
}

.btn-copilot-pill.copilot-closed {
    background: #f8fafc;
    color: #64748b;
    border-color: #e2e8f0;
}

.chapter-nav-segmented {
    display: inline-flex;
    align-items: center;
    background: #ffffff;
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    padding: 3px;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.chapter-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 16px;
    font-size: 12px;
    font-weight: 700;
    color: #475569;
    text-decoration: none;
    border-radius: 7px;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.18s ease;
}

.chapter-nav-btn:hover {
    color: #0f172a;
    background: #f8fafc;
}

.chapter-nav-btn.active {
    background: #2563eb;
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35);
}

.builder-audit-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 12.5px;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: 10px;
    white-space: nowrap;
    flex-shrink: 0;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
    transition: all 0.2s ease;
}

.builder-audit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

@media (max-width: 900px) {
    .chapter-builder-header {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
    }
    .builder-header-actions {
        justify-content: space-between;
        width: 100%;
    }
}

/* 3-Column Workspace Editor Layout - Expansive & Focused */
.workspace-grid {
    display: grid;
    grid-template-columns: 225px minmax(0, 1fr) 280px;
    gap: 14px;
    min-height: calc(100vh - 120px);
    align-items: start;
    transition: grid-template-columns 0.28s cubic-bezier(0.16, 1, 0.3, 1),
                gap 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.workspace-grid > script,
.workspace-grid > style {
    display: none !important;
}

.workspace-grid.no-transition,
.workspace-grid.no-transition *,
.workspace-grid.no-transition .copilot-pane,
.workspace-grid.no-transition .copilot-full-content,
.workspace-grid.no-transition .copilot-icon-rail {
    transition: none !important;
    animation: none !important;
}

/* Zero-Layout-Shift Instant Preload */
html.copilot-is-collapsed .workspace-grid {
    grid-template-columns: 225px minmax(0, 1fr) 56px;
}
html.copilot-is-collapsed .workspace-grid.hide-subbab,
html.copilot-is-collapsed.subbab-is-hidden .workspace-grid {
    grid-template-columns: minmax(0, 1fr) 56px;
}
html.subbab-is-hidden .workspace-grid:not(.copilot-collapsed) {
    grid-template-columns: minmax(0, 1fr) 280px;
}
html.subbab-is-hidden .workspace-grid .subbab-nav-pane {
    display: none !important;
}

/* Dynamic Toggle Classes to Expand Editor */
.workspace-grid.hide-subbab {
    grid-template-columns: minmax(0, 1fr) 280px;
}
.workspace-grid.hide-subbab .subbab-nav-pane {
    display: none !important;
}

.workspace-grid.copilot-collapsed {
    grid-template-columns: 225px minmax(0, 1fr) 56px;
}
.workspace-grid.hide-subbab.copilot-collapsed {
    grid-template-columns: minmax(0, 1fr) 56px;
}

.workspace-grid.hide-copilot {
    grid-template-columns: 225px minmax(0, 1fr);
}
.workspace-grid.hide-copilot .copilot-pane {
    display: none !important;
}

/* Focus Mode: Ruang Menulis Penuh & Luas (1 Kolom Penuh 100%) */
.workspace-grid.focus-mode,
html .workspace-grid.focus-mode,
html.copilot-is-collapsed .workspace-grid.focus-mode,
html.subbab-is-hidden .workspace-grid.focus-mode,
html.rp-in-focus-mode .workspace-grid,
html.copilot-is-collapsed.rp-in-focus-mode .workspace-grid,
html.subbab-is-hidden.rp-in-focus-mode .workspace-grid {
    grid-template-columns: minmax(0, 1fr) !important;
}

.workspace-grid.focus-mode .subbab-nav-pane,
.workspace-grid.focus-mode .copilot-pane,
html.rp-in-focus-mode .workspace-grid .subbab-nav-pane,
html.rp-in-focus-mode .workspace-grid .copilot-pane {
    display: none !important;
}

.workspace-grid.focus-mode .editor-pane,
html.rp-in-focus-mode .workspace-grid .editor-pane {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    max-width: 100% !important;
}

/* Panel 1: Subbab Navigation - Ultra-Premium SaaS Card */
.subbab-nav-pane {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 16px;
    padding: 16px 12px;
    height: fit-content;
    box-shadow: 0 4px 16px -4px rgba(15, 23, 42, 0.05), 0 1px 3px rgba(15, 23, 42, 0.03);
    position: relative;
    box-sizing: border-box;
}

.subbab-pane-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 3px;
    padding: 0 2px;
}

.subbab-pane-title {
    font-size: 13.5px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.2px;
    margin: 0;
}

.subbab-count-pill {
    font-size: 10px;
    font-weight: 700;
    background: #f1f5f9;
    color: #475569;
    padding: 2px 7px;
    border-radius: 9999px;
    border: 1px solid #e2e8f0;
}

.subbab-pane-desc {
    font-size: 11px;
    color: #64748b;
    margin: 0 0 10px 2px;
}

/* Sequence Tip Banner with Yellow / Amber Background - Wajib Dipatuhi */
.subbab-sequence-tip {
    display: flex;
    align-items: flex-start;
    gap: 8.5px;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 60%, #fde68a 100%);
    border: 1px solid #fcd34d;
    border-left: 4px solid #f59e0b;
    border-radius: 10px;
    padding: 10px 11px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px -1px rgba(217, 119, 6, 0.16), 0 1px 3px rgba(217, 119, 6, 0.08);
}

.seq-tip-icon {
    font-size: 14px;
    line-height: 1.2;
    flex-shrink: 0;
    margin-top: 1px;
}

.seq-tip-text {
    font-size: 11px;
    line-height: 1.45;
    color: #78350f;
}

.seq-tip-text strong {
    color: #92400e;
    font-weight: 800;
}

.seq-tip-text em {
    font-style: italic;
    color: #b45309;
    font-weight: 700;
}

/* Subbab List & Unified Cards */
.subbab-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin: 0;
    padding: 0;
}

.subbab-item-row {
    position: relative !important;
    display: block !important;
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 11px !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03) !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

.subbab-item-row:hover {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 10px -2px rgba(15, 23, 42, 0.06) !important;
}

/* Active Subbab Card with Rich Gradient Background */
.subbab-item-row.active-subbab-li {
    background: linear-gradient(135deg, #eff6ff 0%, #f0f9ff 60%, #ffffff 100%) !important;
    border: 1.5px solid #3b82f6 !important;
    border-left: 4px solid #2563eb !important;
    box-shadow: 0 4px 14px -2px rgba(37, 99, 235, 0.16), 0 1px 3px rgba(37, 99, 235, 0.06) !important;
}

.subbab-item-row.active-subbab-li .subbab-link-title {
    color: #1d4ed8 !important;
    font-weight: 700 !important;
}

/* Recommended Next Step Card */
.subbab-item-row.subbab-row-recommended:not(.active-subbab-li) {
    background: linear-gradient(135deg, #fafcff 0%, #f0f7ff 100%) !important;
    border: 1.5px dashed #93c5fd !important;
    box-shadow: 0 2px 8px -1px rgba(59, 130, 246, 0.08) !important;
}

/* Link Container filling the entire card */
.subbab-link {
    display: block !important;
    padding: 10px 11px !important;
    text-decoration: none !important;
    background: transparent !important;
    border: none !important;
    border-left: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    color: inherit !important;
}

.subbab-link:hover {
    background: transparent !important;
    transform: none !important;
}

.subbab-link.active {
    background: transparent !important;
    border-left-color: transparent !important;
    box-shadow: none !important;
}

.subbab-link-title-row {
    margin-bottom: 4px;
}

.subbab-link-title {
    display: block !important;
    font-size: 12px !important;
    font-weight: 650 !important;
    color: #1e293b !important;
    line-height: 1.35 !important;
    word-break: break-word !important;
}

.subbab-badge-wrap {
    margin: 3px 0 5px 0 !important;
}

.badge-next-step {
    display: inline-flex !important;
    align-items: center !important;
    gap: 3px !important;
    font-size: 9.5px !important;
    font-weight: 700 !important;
    padding: 2px 7px !important;
    border-radius: 5px !important;
    background: #dbeafe !important;
    color: #1e40af !important;
    border: 1px solid #bfdbfe !important;
    letter-spacing: 0.2px !important;
    animation: pulseSoft 2.5s infinite ease-in-out !important;
}

/* Meta Footer Row */
.subbab-link-meta {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    font-size: 10.5px !important;
    padding-right: 52px !important; /* Guaranteed space for AI button */
}

.subbab-version {
    color: #64748b !important;
    font-weight: 500 !important;
    font-size: 10px !important;
}

.subbab-meta-dot {
    color: #cbd5e1 !important;
    font-size: 10px !important;
}

.subbab-status-badge {
    font-size: 10.5px !important;
    font-weight: 600 !important;
}

.subbab-status-badge.status-filled {
    color: #059669 !important;
    font-weight: 700 !important;
}

.subbab-status-badge.status-empty {
    color: #94a3b8 !important;
}

.subbab-status-badge.status-next-action {
    color: #2563eb !important;
    font-weight: 700 !important;
}

/* Embedded Compact AI Button on Bottom-Right of Card */
.subbab-item-row .btn-subbab-ai-badge {
    position: absolute !important;
    right: 8px !important;
    bottom: 8px !important;
    z-index: 3 !important;
    background: linear-gradient(135deg, #4f46e5 0%, #2563eb 100%) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 6px !important;
    padding: 3px 8px !important;
    font-size: 10.5px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 3px !important;
    line-height: 1.2 !important;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25) !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.subbab-item-row .btn-subbab-ai-badge:hover {
    background: linear-gradient(135deg, #4338ca 0%, #1d4ed8 100%) !important;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.4) !important;
    transform: scale(1.05) !important;
}

.subbab-item-row .btn-subbab-ai-badge.btn-ai-recommended {
    background: linear-gradient(135deg, #7c3aed 0%, #2563eb 100%) !important;
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.2), 0 2px 8px rgba(124, 58, 237, 0.3) !important;
}

/* Sequence Order Alert on Top of Editor */
.sequence-order-alert {
    background: linear-gradient(135deg, #f0fdf4 0%, #f8fafc 50%, #eff6ff 100%);
    border: 1px solid #bfdbfe;
    border-left: 4px solid #2563eb;
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 16px;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.05);
}

.seq-alert-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10.5px;
    font-weight: 700;
    color: #1d4ed8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.seq-alert-title {
    font-size: 13.5px;
    font-weight: 700;
    color: #1e3a8a;
    margin: 0 0 6px 0;
}

.seq-alert-text {
    font-size: 12.5px;
    color: #334155;
    line-height: 1.5;
    margin: 0 0 12px 0;
}

.seq-alert-text strong {
    color: #0f172a;
    font-weight: 600;
}

.seq-alert-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-seq-primary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #2563eb;
    color: #ffffff;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.2);
}

.btn-seq-primary:hover {
    background: #1d4ed8;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(37, 99, 235, 0.3);
}

.seq-alert-secondary {
    font-size: 11.5px;
    color: #64748b;
    font-style: italic;
}

/* Modal Sequence Guidance Alert */
.subbab-ai-sequence-alert {
    background: #fffbeb;
    border: 1px solid #fef3c7;
    border-left: 4px solid #f59e0b;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 14px;
}

.ai-seq-alert-inner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.ai-seq-icon {
    font-size: 16px;
    line-height: 1.2;
    flex-shrink: 0;
}

.ai-seq-text {
    font-size: 12px;
    color: #78350f;
    line-height: 1.45;
}

.ai-seq-text strong {
    color: #451a03;
    font-weight: 700;
}

.ai-seq-link {
    display: inline-block;
    margin-left: 8px;
    color: #b45309;
    font-weight: 700;
    text-decoration: underline;
    transition: color 0.15s ease;
}

.ai-seq-link:hover {
    color: #78350f;
}

.subbab-ebook-box {
    margin-top: 16px;
    padding: 12px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.subbab-ebook-label {
    font-size: 10.5px;
    color: #475569;
    margin-bottom: 8px;
    text-align: center;
}

.subbab-ebook-btn {
    width: 100%;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    padding: 7px 10px;
    display: block;
    box-sizing: border-box;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #334155;
    transition: all 0.2s ease;
}

.subbab-ebook-btn:hover {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #1d4ed8;
}

/* Panel 2: Center Document Editor */
.editor-pane {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 22px 24px;
    display: flex;
    flex-direction: column;
    min-width: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.editor-pane #sectionForm {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    width: 100%;
}

.editor-textarea-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-bottom: 12px;
}

.editor-header {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-subtle);
}

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

.editor-meta-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.editor-project-tag {
    font-size: 12px;
    color: #64748b;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 3px 9px;
    border-radius: 6px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    max-width: 260px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.editor-meta-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.editor-stat-pill {
    font-size: 12px;
    color: #475569;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    padding: 4px 10px;
    border-radius: 9999px;
    font-weight: 600;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
}

.editor-autosave-pill {
    font-size: 11.5px;
    color: #059669;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    padding: 4px 10px;
    border-radius: 9999px;
    font-weight: 600;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
}

.editor-save-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: 12.5px;
    font-weight: 600;
    border-radius: 8px;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(37, 99, 235, 0.2);
    transition: all 0.15s ease;
}

.editor-save-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.25);
}

/* Save Pulse Glow Effect */
@keyframes savedPulseGlow {
    0% { background-color: #bbf7d0; border-color: #4ade80; transform: scale(1.06); box-shadow: 0 0 10px rgba(34, 197, 94, 0.35); }
    100% { background-color: #ecfdf5; border-color: #a7f3d0; transform: scale(1); box-shadow: none; }
}

.editor-autosave-pill.saved-pulse {
    animation: savedPulseGlow 1.2s ease-out;
}

/* Sound Notification Toggle Button */
.btn-sound-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 5px 9px;
    font-size: 13px;
    cursor: pointer;
    color: #475569;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.btn-sound-toggle:hover {
    background: #eff6ff;
    border-color: #93c5fd;
    transform: scale(1.08);
}

.btn-sound-toggle.muted {
    opacity: 0.65;
    background: #f1f5f9;
    border-color: #e2e8f0;
}

/* Floating Toast Notification for Instant Feedback */
.rp-toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.rp-toast {
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-left: 4px solid #10b981;
    border-radius: 10px;
    padding: 10px 16px;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.15), 0 3px 8px -2px rgba(15, 23, 42, 0.08);
    font-size: 12.5px;
    font-weight: 650;
    color: #0f172a;
    animation: toastSlideIn 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.rp-toast-error {
    border-left-color: #ef4444;
}

.rp-toast-info {
    border-left-color: #3b82f6;
}

.rp-toast-icon {
    font-size: 15px;
    line-height: 1;
}

@keyframes toastSlideIn {
    from { opacity: 0; transform: translateY(12px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.editor-title-box {
    width: 100%;
}

.editor-section-title {
    font-size: 18.5px;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
    line-height: 1.35;
    letter-spacing: -0.015em;
    word-break: break-word;
}

.editor-textarea {
    flex: 1;
    width: 100% !important;
    min-height: 480px !important;
    border: 1.5px solid #cbd5e1;
    border-radius: 12px;
    padding: 20px 22px;
    font-family: "Times New Roman", Times, serif;
    font-size: 15.5px;
    line-height: 1.75;
    color: #1e293b;
    background-color: #fafbfc;
    resize: vertical;
    outline: none;
    box-sizing: border-box !important;
    transition: all 0.2s ease;
}

.editor-textarea:focus {
    background-color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 0 3.5px rgba(37, 99, 235, 0.12);
}

.editor-footer-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: 11.5px;
    color: #64748b;
    flex-wrap: wrap;
    margin-top: 6px;
    padding-top: 4px;
}

.editor-footer-rule {
    color: #475569;
    display: inline-flex;
    align-items: center;
}

.editor-footer-autosave {
    color: #94a3b8;
    display: inline-flex;
    align-items: center;
}

/* Panel 3: RisetPilot Copilot & Context */
.copilot-pane {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    height: fit-content;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    transition: width 0.28s cubic-bezier(0.16, 1, 0.3, 1),
                padding 0.28s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.2s ease,
                box-shadow 0.2s ease;
    position: relative;
    box-sizing: border-box;
    overflow: hidden;
    width: 100%;
}

.copilot-full-content {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    min-width: 242px;
    opacity: 1;
    transform: translateX(0);
    transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.copilot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 10px;
}

.copilot-header-brand {
    font-size: 13.5px;
    font-weight: 700;
    color: #1e40af;
    display: flex;
    align-items: center;
    gap: 6px;
}

.copilot-bolt {
    font-size: 15px;
}

.copilot-title {
    font-size: 13.5px;
    font-weight: 700;
    color: #1e40af;
}

.copilot-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.copilot-badge {
    font-size: 10px;
}

.btn-copilot-pane-toggle {
    background: transparent;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
}

.btn-copilot-pane-toggle:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #1e40af;
}

/* Collapsed State: Transform Panel into Slim Vertical Icon Rail */
.workspace-grid.copilot-collapsed .copilot-pane,
html.copilot-is-collapsed .workspace-grid .copilot-pane {
    padding: 12px 6px;
    width: 56px;
    align-items: center;
    border-color: #e2e8f0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.workspace-grid.copilot-collapsed .copilot-full-content,
html.copilot-is-collapsed .workspace-grid .copilot-full-content {
    opacity: 0;
    transform: translateX(16px);
    pointer-events: none;
    position: absolute;
    visibility: hidden;
    height: 0;
    overflow: hidden;
}

.copilot-icon-rail {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
    opacity: 0;
    transform: scale(0.92);
    pointer-events: none;
    position: absolute;
    visibility: hidden;
    transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.workspace-grid.copilot-collapsed .copilot-icon-rail,
html.copilot-is-collapsed .workspace-grid .copilot-icon-rail {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
    position: relative;
    visibility: visible;
}

.copilot-rail-btn {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: #f8fafc;
    color: #334155;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
    font-size: 17px;
    padding: 0;
    user-select: none;
}

.copilot-rail-btn:active {
    transform: scale(0.91) !important;
}

.copilot-rail-btn:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.12);
}

.copilot-rail-btn.rail-btn-primary {
    background: #eff6ff;
    border-color: #dbeafe;
    color: #1d4ed8;
}

.copilot-rail-btn.rail-btn-primary:hover {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}

.copilot-rail-btn.rail-btn-ai {
    background: linear-gradient(135deg, #f0fdf4, #eff6ff);
    border: 1px solid #bfdbfe;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.08);
}

.copilot-rail-btn.rail-btn-ai:hover {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    border-color: transparent;
    color: #ffffff;
}

.copilot-rail-btn.rail-btn-toggle {
    color: #64748b;
    border-color: #e2e8f0;
}

.copilot-rail-btn.rail-btn-toggle:hover {
    background: #1e293b;
    border-color: #1e293b;
    color: #ffffff;
}

.copilot-rail-divider {
    width: 26px;
    height: 1px;
    background: #e2e8f0;
    margin: 2px 0;
}

/* Tooltip floating to the left of the rail buttons */
.copilot-rail-btn .rail-tooltip {
    position: absolute;
    right: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%) translateX(4px);
    background: #0f172a;
    color: #f8fafc;
    font-size: 11.5px;
    font-weight: 600;
    padding: 5px 9px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 999;
}

.copilot-rail-btn .rail-tooltip::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -4px;
    transform: translateY(-50%);
    border-width: 4px 0 4px 5px;
    border-style: solid;
    border-color: transparent transparent transparent #0f172a;
}

.copilot-rail-btn:hover .rail-tooltip {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

.highlight-glow {
    box-shadow: 0 0 0 2px #3b82f6, 0 4px 14px rgba(59, 130, 246, 0.25) !important;
    border-color: #93c5fd !important;
    transition: all 0.3s ease;
}

.copilot-card {
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 12px 14px;
}

.copilot-card-title {
    font-size: 12px;
    font-weight: 700;
    color: #334155;
    margin-bottom: 7px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.copilot-guidance-text {
    font-size: 11.5px;
    color: #475569;
    line-height: 1.45;
    margin: 0;
}

.copilot-ai-card {
    border-color: #bfdbfe;
    background: #eff6ff;
}

.copilot-ai-title {
    color: #1d4ed8;
}

.copilot-ai-subtitle {
    font-size: 11px;
    color: #3b82f6;
    margin-bottom: 8px;
    line-height: 1.4;
}

.copilot-notes-input {
    font-size: 11.5px;
    border-radius: 6px;
    resize: vertical;
}

.copilot-btn-ask {
    width: 100%;
    font-size: 12px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 7px;
}

.copilot-sources-empty {
    font-size: 11px;
    color: #94a3b8;
    margin: 0;
}

.copilot-sources-link {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
}

.copilot-sources-list {
    max-height: 140px;
    overflow-y: auto;
    font-size: 11.5px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.copilot-source-item {
    background: #ffffff;
    padding: 7px 9px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.copilot-source-title {
    color: #1e293b;
    display: block;
    font-size: 11px;
    line-height: 1.35;
}

.copilot-source-meta {
    color: #64748b;
    font-size: 10px;
    margin-top: 2px;
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.data-table th {
    background-color: #f8fafc;
    color: #475569;
    font-weight: 600;
    text-align: left;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-subtle);
    color: #1e293b;
}

.data-table tr:hover td {
    background-color: #f8fafc;
}

/* Responsive Breakpoints */
@media (max-width: 1350px) {
    .dashboard-layout {
        grid-template-columns: minmax(0, 1fr);
    }
    .stage-cards-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 1100px) {
    .workspace-grid {
        grid-template-columns: 185px minmax(0, 1fr);
    }
    .copilot-pane {
        grid-column: span 2;
    }
    .workspace-grid.hide-subbab {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 1024px) {
    .stage-cards-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .bottom-cards-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .workspace-grid {
        grid-template-columns: 1fr;
    }
    .copilot-pane {
        grid-column: span 1;
    }
}

@media (max-width: 768px) {
    .app-sidebar {
        display: none;
    }
    .app-main {
        width: 100% !important;
        max-width: 100% !important;
    }
    .stage-cards-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .project-form-grid, .project-form-grid-2 {
        grid-template-columns: 1fr;
    }
    .page-container {
        padding: 16px;
    }
    .app-topbar {
        padding: 0 16px;
    }
    .topbar-project-pill {
        display: none;
    }
}

/* Onboarding & Project Setup 2-Part Form - Full Width Fit Screen */
#projectCreateCard {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin-top: 6px;
    margin-bottom: 24px;
}

.onboarding-sections-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    margin-bottom: 20px;
    width: 100%;
    box-sizing: border-box;
}

.onboarding-flow-ribbon {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px 18px;
    margin-bottom: 20px;
    gap: 12px;
    flex-wrap: wrap;
}

.onboarding-flow-step {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #475569;
}

.onboarding-flow-step strong {
    color: #0f172a;
}

.onboarding-flow-num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #2563eb;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.onboarding-flow-num.step2 {
    background: #10b981;
}

.onboarding-flow-connector {
    color: #94a3b8;
    font-weight: bold;
    font-size: 13px;
}

.onboarding-part-card {
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.05);
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: all 0.25s ease;
    position: relative;
    border: 1.5px solid var(--border-color);
    background: #ffffff;
}

.onboarding-part-card.part-identity {
    background: linear-gradient(180deg, #f0f7ff 0%, #f8fafc 40%, #ffffff 100%);
    border: 1.5px solid #bfdbfe;
    border-top: 4px solid #2563eb;
}

.onboarding-part-card.part-research {
    background: linear-gradient(180deg, #f0fdf4 0%, #f8fafc 40%, #ffffff 100%);
    border: 1.5px solid #bbf7d0;
    border-top: 4px solid #10b981;
}

.onboarding-part-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    gap: 10px;
    flex-wrap: wrap;
}

.onboarding-part-title {
    font-size: 14.5px;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.onboarding-part-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
}

.onboarding-part-card.part-identity .onboarding-part-icon {
    background: #dbeafe;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
}

.onboarding-part-card.part-research .onboarding-part-icon {
    background: #dcfce7;
    border: 1px solid #a7f3d0;
    color: #059669;
}

.onboarding-part-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
    letter-spacing: 0.3px;
}

.onboarding-part-badge.green {
    background: #ecfdf5;
    color: #059669;
    border-color: #a7f3d0;
}

.onboarding-tip-card {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 1px solid #fde68a;
    border-radius: 10px;
    padding: 10px 12px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 6px;
    font-size: 11.5px;
    color: #92400e;
    line-height: 1.45;
}

.onboarding-tip-icon {
    font-size: 14px;
    line-height: 1;
    flex-shrink: 0;
}

.onboarding-flex-card {
    background: linear-gradient(135deg, #eff6ff 0%, #e0f2fe 100%);
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    padding: 10px 14px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 8px;
    font-size: 11.5px;
    color: #1e40af;
    line-height: 1.45;
}

.onboarding-action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1.5px solid #e2e8f0;
    border-radius: var(--radius-lg);
    padding: 14px 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.onboarding-submit-btn {
    padding: 11px 26px;
    font-size: 13.5px;
    font-weight: 700;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    border: none;
    border-radius: 9px;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.onboarding-submit-btn:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.38);
}

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

.form-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

@media (max-width: 900px) {
    .onboarding-sections-grid {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 600px) {
    .form-grid-2, .form-grid-3 {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Pedoman Kampus (Jam 2) - Streamlined 3-Step Guided Flow & Paper Mockup
   ========================================================================== */

/* Visual 3-Step Flow Stepper */
.guide-flow-stepper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 12px 18px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-xs);
    gap: 12px;
}

.guide-flow-step {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.guide-flow-step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    flex-shrink: 0;
    background: #eff6ff;
    color: #2563eb;
    border: 1.5px solid #bfdbfe;
}

.guide-flow-step-num.active {
    background: #2563eb;
    color: #ffffff;
    border-color: #1d4ed8;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

.guide-flow-step-num.done {
    background: #ecfdf5;
    color: #059669;
    border-color: #a7f3d0;
}

.guide-flow-step-text h4 {
    font-size: 12.5px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.guide-flow-step-text p {
    font-size: 11px;
    color: #64748b;
    margin: 0;
}

.guide-flow-sep {
    color: #cbd5e1;
    font-size: 16px;
    font-weight: 300;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .guide-flow-stepper {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .guide-flow-sep {
        display: none;
    }
}

/* Step Cards */
.guide-step-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 18px;
}

.guide-step-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 6px;
}

/* Toggle Accordion for Custom Format */
.btn-toggle-custom-format {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 11px 16px;
    background: #ffffff;
    border: 1.5px dashed #cbd5e1;
    border-radius: var(--radius-md);
    color: #334155;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 14px;
    font-family: inherit;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.btn-toggle-custom-format:hover {
    background: #f0f9ff;
    border-color: #38bdf8;
    color: #0369a1;
}

.guide-custom-drawer {
    margin-top: 12px;
    padding: 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
    animation: fadeInCustom 0.2s ease;
}

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

.guide-presets-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 14px;
    margin-bottom: 12px;
}

.guide-preset-card {
    border-radius: 14px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    min-width: 0;
    box-sizing: border-box;
    overflow: hidden;
}

/* Preset 1: Standar Nasional (Distinct Light Blue Academic Theme) */
.guide-preset-card.preset-national {
    background: linear-gradient(145deg, #f0f7ff 0%, #e0f2fe 100%);
    border: 1.5px solid #bae6fd;
}
.guide-preset-card.preset-national:hover {
    border-color: #0284c7;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -4px rgba(2, 132, 199, 0.2);
}
.guide-preset-card.preset-national.active {
    background: linear-gradient(145deg, #e0f2fe 0%, #bfdbfe 100%);
    border: 2px solid #2563eb;
    box-shadow: 0 8px 24px -4px rgba(37, 99, 235, 0.3);
}

/* Preset 2: Format Simetris (Distinct Mint / Emerald Tech Theme) */
.guide-preset-card.preset-symmetric {
    background: linear-gradient(145deg, #f0fdf4 0%, #dcfce7 100%);
    border: 1.5px solid #bbf7d0;
}
.guide-preset-card.preset-symmetric:hover {
    border-color: #16a34a;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -4px rgba(22, 163, 74, 0.2);
}
.guide-preset-card.preset-symmetric.active {
    background: linear-gradient(145deg, #dcfce7 0%, #bbf7d0 100%);
    border: 2px solid #16a34a;
    box-shadow: 0 8px 24px -4px rgba(22, 163, 74, 0.3);
}

/* Preset 3: Format Double Spasi (Distinct Warm Amber / Gold S2 Theme) */
.guide-preset-card.preset-double {
    background: linear-gradient(145deg, #fffbeb 0%, #fef3c7 100%);
    border: 1.5px solid #fde68a;
}
.guide-preset-card.preset-double:hover {
    border-color: #d97706;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -4px rgba(217, 119, 6, 0.2);
}
.guide-preset-card.preset-double.active {
    background: linear-gradient(145deg, #fef3c7 0%, #fde68a 100%);
    border: 2px solid #d97706;
    box-shadow: 0 8px 24px -4px rgba(217, 119, 6, 0.3);
}

.guide-preset-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    gap: 8px;
    width: 100%;
}

.guide-preset-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
}

.guide-preset-title {
    font-size: 14px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.35;
    margin-bottom: 8px;
    letter-spacing: -0.2px;
}

.guide-preset-badge {
    font-size: 10px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
    letter-spacing: 0.2px;
    white-space: nowrap;
    flex-shrink: 0;
}
.guide-preset-badge.badge-national {
    background: #dbeafe;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}
.guide-preset-card.preset-national.active .guide-preset-badge.badge-national {
    background: #2563eb;
    color: #ffffff;
    border-color: #1d4ed8;
}

.guide-preset-badge.badge-symmetric {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}
.guide-preset-card.preset-symmetric.active .guide-preset-badge.badge-symmetric {
    background: #16a34a;
    color: #ffffff;
    border-color: #15803d;
}

.guide-preset-badge.badge-double {
    background: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
}
.guide-preset-card.preset-double.active .guide-preset-badge.badge-double {
    background: #d97706;
    color: #ffffff;
    border-color: #b45309;
}

.guide-preset-desc {
    font-size: 11.5px;
    color: #475569;
    line-height: 1.55;
    margin: 0 0 12px 0;
}

/* Status Button at Bottom of Preset Card */
.guide-preset-status {
    margin-top: auto;
    font-size: 11.5px;
    font-weight: 700;
    padding: 7px 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    transition: all 0.2s ease;
}

.guide-preset-card:not(.active) .guide-preset-status {
    background: rgba(255, 255, 255, 0.85);
    color: #64748b;
    border: 1px solid rgba(0, 0, 0, 0.08);
}
.guide-preset-card:not(.active):hover .guide-preset-status {
    background: #ffffff;
    color: #0f172a;
    border-color: rgba(0, 0, 0, 0.15);
}

.guide-preset-card.active .guide-preset-status {
    color: #ffffff;
}
.guide-preset-card.preset-national.active .guide-preset-status {
    background: #2563eb;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.4);
}
.guide-preset-card.preset-symmetric.active .guide-preset-status {
    background: #16a34a;
    box-shadow: 0 2px 6px rgba(22, 163, 74, 0.4);
}
.guide-preset-card.preset-double.active .guide-preset-status {
    background: #d97706;
    box-shadow: 0 2px 6px rgba(217, 119, 6, 0.4);
}

/* Paper Preview Mockup */
.paper-preview-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}

.paper-preview-frame {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 16px 14px 16px 20px;
    position: relative;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    margin-top: 10px;
    min-height: 210px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background-image: 
        linear-gradient(to right, #f8fafc 1px, transparent 1px),
        linear-gradient(to bottom, #f8fafc 1px, transparent 1px);
    background-size: 20px 20px;
}

.paper-margin-tag {
    position: absolute;
    font-size: 9.5px;
    font-weight: 700;
    color: #2563eb;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    padding: 1px 5px;
    border-radius: 3px;
    line-height: 1;
}

.paper-margin-top { top: 4px; left: 50%; transform: translateX(-50%); }
.paper-margin-left { left: 4px; top: 50%; transform: translateY(-50%) rotate(-90deg); transform-origin: center center; }
.paper-margin-right { right: 4px; top: 50%; transform: translateY(-50%) rotate(90deg); transform-origin: center center; }
.paper-margin-bottom { bottom: 4px; left: 50%; transform: translateX(-50%); }

.paper-content-preview {
    border: 1px dashed #93c5fd;
    border-radius: 4px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.9);
    margin: 12px 14px;
}

.paper-sample-title {
    font-size: 11px;
    font-weight: 800;
    text-align: center;
    color: #0f172a;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.paper-sample-body {
    font-size: 10px;
    color: #475569;
    line-height: 1.5;
    text-align: justify;
}

/* Chapter Structure Cards */
.guide-chapter-box {
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-lg);
    padding: 12px 14px;
    background: #f8fafc;
    margin-bottom: 10px;
    transition: all 0.2s ease;
}

.guide-chapter-box:hover {
    background: #ffffff;
    border-color: #cbd5e1;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

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

.guide-chapter-title {
    font-size: 12.5px;
    font-weight: 700;
    color: #1d4ed8;
    display: flex;
    align-items: center;
    gap: 6px;
}

.guide-sub-list {
    list-style: none;
    padding-left: 4px;
    margin: 0;
    font-size: 11.5px;
    color: #334155;
    line-height: 1.55;
}

.guide-sub-list li {
    display: flex;
    align-items: center;
    gap: 6px;
}

.guide-sub-list li::before {
    content: "•";
    color: #3b82f6;
    font-weight: bold;
}

/* Next Step CTA Bar */
.guide-next-step-bar {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
    border-radius: var(--radius-xl);
    padding: 18px 24px;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 24px;
    box-shadow: 0 8px 20px -4px rgba(30, 58, 138, 0.3);
    flex-wrap: wrap;
}

.guide-next-step-info h3 {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 3px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.guide-next-step-info p {
    font-size: 12.5px;
    color: #cbd5e1;
    margin: 0;
}

.guide-next-step-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    font-size: 13.5px;
    font-weight: 700;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
    cursor: pointer;
}

.guide-next-step-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.5);
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    color: #ffffff;
}

@media (max-width: 960px) {
    .guide-presets-grid {
        grid-template-columns: 1fr;
    }
    .guide-layout-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ==========================================================================
   Topic Wizard (Jam 3–5) - Step Flow & Interactive Candidate Cards
   ========================================================================== */
.guide-intro-banner {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 50%, #e0f2fe 100%);
    border: 1.5px solid #93c5fd;
    border-left: 5px solid #2563eb;
    border-radius: var(--radius-lg);
    padding: 14px 18px;
    margin-bottom: 20px;
    box-shadow: 0 4px 14px -3px rgba(37, 99, 235, 0.12);
}

.guide-intro-banner h2 {
    font-size: 15px;
    font-weight: 800;
    color: #1e3a8a;
    margin: 0 0 6px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.guide-intro-banner p {
    font-size: 12.5px;
    color: #334155;
    line-height: 1.55;
    margin: 0;
}

.topic-step-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 0.5px;
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
    text-transform: uppercase;
}

.topic-step-badge.step2 {
    background: #ecfdf5;
    color: #059669;
    border-color: #a7f3d0;
}

.demo-fill-btn {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    background: #f8fafc;
    border: 1px dashed #94a3b8;
    color: #475569;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.demo-fill-btn:hover {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #1d4ed8;
    border-style: solid;
}

.topic-candidate-card {
    padding: 12px 14px;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
}

.topic-candidate-card:hover {
    border-color: #3b82f6;
    background: #f8fafc;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.1);
}

.topic-candidate-card.active {
    border-color: #2563eb;
    background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
}

.topic-candidate-radio {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #94a3b8;
    margin-top: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}

.topic-candidate-card.active .topic-candidate-radio {
    border-color: #2563eb;
    background: #2563eb;
}

.topic-candidate-card.active .topic-candidate-radio::after {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ffffff;
}

.topic-candidate-content {
    flex: 1;
    min-width: 0;
}

.topic-candidate-title {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.4;
    margin-bottom: 3px;
}

.topic-candidate-reason {
    font-size: 11.5px;
    color: #64748b;
    line-height: 1.4;
}

@media (max-width: 960px) {
    .topic-workflow-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ==========================================================================
   E-Book Guidance Banner (Setiap Laman Wajib Berpedoman pada E-Book)
/* ==========================================================================
   E-Book Guidance Banner (Kuning Stabilo - Selalu Menjadi Perhatian)
   ========================================================================== */
.ebook-guidance-banner {
    background: linear-gradient(135deg, #fef9c3 0%, #fef08a 40%, #fde047 100%);
    border: 1.5px solid #eab308;
    border-left: 5px solid #ca8a04;
    border-radius: 12px;
    padding: 10px 16px;
    margin-bottom: 14px;
    box-shadow: 0 4px 14px rgba(234, 179, 8, 0.3), 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.25s ease;
}

.ebook-guidance-banner.minimized {
    padding: 8px 14px;
    background: linear-gradient(135deg, #fef9c3 0%, #fef08a 100%);
    border-color: #eab308;
}

.ebook-guidance-banner.minimized .egb-subline,
.ebook-guidance-banner.minimized .egb-content {
    display: none !important;
}

.ebook-guidance-banner.minimized .egb-badge-row {
    margin-bottom: 0 !important;
}

.egb-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.egb-left {
    flex: 1;
    min-width: 280px;
}

.egb-badge-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.egb-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #0f172a;
    color: #fef08a;
    font-size: 11px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
    letter-spacing: 0.4px;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.2);
}

.egb-chapter {
    font-size: 12.5px;
    font-weight: 800;
    color: #0f172a;
}

.egb-tag {
    font-size: 11px;
    font-weight: 800;
    background: #dc2626;
    color: #ffffff;
    padding: 2px 8px;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(220, 38, 38, 0.25);
}

.egb-rule {
    font-size: 12.5px;
    color: #1e293b;
    line-height: 1.5;
}

.egb-rule-label {
    font-weight: 800;
    color: #854d0e;
    margin-right: 4px;
}

.egb-rule-text {
    font-style: italic;
    color: #0f172a;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.55);
    padding: 1px 6px;
    border-radius: 4px;
    border: 1px solid rgba(234, 179, 8, 0.4);
}

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

.btn-egb-primary {
    background: #1e3a8a;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    padding: 7px 14px;
    border-radius: 8px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(30, 58, 138, 0.35);
    transition: all 0.15s ease;
}

.btn-egb-primary:hover {
    background: #0f172a;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.4);
}

.btn-egb-preview {
    background: #ffffff;
    border: 1.5px solid #d97706;
    color: #78350f;
    font-size: 12px;
    font-weight: 700;
    padding: 7px 12px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s ease;
}

.btn-egb-preview:hover {
    background: #fefce8;
    border-color: #b45309;
    color: #451a03;
}

.btn-egb-toggle {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(202, 138, 4, 0.35);
    color: #854d0e;
    padding: 5px 8px;
    font-size: 12px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.btn-egb-toggle:hover {
    background: #ffffff;
    color: #713f12;
}

.egb-subline {
    border-top: 1px dashed rgba(161, 98, 7, 0.4);
    margin-top: 8px;
    padding-top: 8px;
    font-size: 11.5px;
    color: #713f12;
    display: flex;
    align-items: center;
    gap: 6px;
}

.egb-tip-text strong {
    color: #854d0e;
}

.topbar-ebook-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.topbar-ebook-pill:hover {
    background: #dbeafe;
    border-color: #93c5fd;
    transform: translateY(-1px);
}

@media (max-width: 768px) {
    .ebook-guidance-banner {
        padding: 10px 14px;
    }
    .egb-main {
        flex-direction: column;
        align-items: flex-start;
    }
    .egb-right {
        width: 100%;
        justify-content: flex-start;
    }
}

/* ==========================================================================
   Academic Dropdown & Quick Search Engine (Kampus, Fakultas, Program Studi)
   ========================================================================== */

.academic-dropdown-wrap {
    position: relative;
    width: 100%;
}

.academic-select-control-row {
    display: flex;
    gap: 8px;
    align-items: center;
    width: 100%;
}

.btn-academic-search {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    border: 1.5px solid #bfdbfe;
    background: linear-gradient(180deg, #ffffff 0%, #f0fdf4 0%, #eff6ff 100%);
    color: #2563eb;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.1);
}

.btn-academic-search:hover {
    border-color: #60a5fa;
    background: #dbeafe;
    color: #1d4ed8;
    transform: translateY(-1.5px);
    box-shadow: 0 4px 14px -2px rgba(37, 99, 235, 0.25);
}

.btn-academic-search.active {
    background: #2563eb;
    border-color: #1d4ed8;
    color: #ffffff;
    box-shadow: 0 4px 14px -2px rgba(37, 99, 235, 0.4);
}

.academic-search-drawer {
    animation: academicDrawerIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.academic-search-results {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f8fafc;
}

.academic-search-results::-webkit-scrollbar {
    width: 6px;
}

.academic-search-results::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 4px;
}

.academic-result-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 12px;
    border: none;
    border-bottom: 1px solid #f1f5f9;
    background: #ffffff;
    cursor: pointer;
    transition: background 0.15s ease, padding-left 0.15s ease;
    font-family: inherit;
    font-size: 13px;
    color: #1e293b;
    text-decoration: none;
}

.academic-result-item:last-child {
    border-bottom: none;
}

.academic-result-item:hover,
.academic-result-item:focus {
    background: #f0f7ff;
    outline: none;
    padding-left: 15px;
}

.academic-result-title {
    font-weight: 600;
    color: #0f172a;
    line-height: 1.4;
}

.academic-result-item:hover .academic-result-title {
    color: #1d4ed8;
}

.academic-result-group {
    font-size: 11px;
    font-weight: 500;
    color: #64748b;
    margin-top: 2px;
}

.academic-search-mark {
    background: #fef08a;
    color: #854d0e;
    font-weight: 700;
    border-radius: 2px;
    padding: 0 2px;
}

.academic-select-highlight {
    animation: academicSelectGlow 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes academicSelectGlow {
    0% {
        box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.35);
        border-color: #2563eb;
    }
    100% {
        box-shadow: none;
        border-color: var(--border-color);
    }
}

/* ==========================================================================
   Kapten Riset - AI Thesis Co-Pilot Companion (Mascot & Dock)
   ========================================================================== */
.kapten-copilot-dock {
    position: fixed;
    bottom: 24px;
    right: 28px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    pointer-events: none;
    font-family: inherit;
}

.kapten-copilot-dock * {
    box-sizing: border-box;
}

.kapten-avatar-btn {
    pointer-events: auto;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    border: 3px solid #ffffff;
    box-shadow: 0 8px 24px -4px rgba(37, 99, 235, 0.45), 0 0 0 1.5px rgba(37, 99, 235, 0.2);
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    outline: none;
    padding: 0;
}

.kapten-avatar-btn:hover {
    transform: scale(1.08) translateY(-3px);
    box-shadow: 0 14px 32px -4px rgba(37, 99, 235, 0.6), 0 0 0 3px rgba(59, 130, 246, 0.4);
}

.kapten-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.kapten-status-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #22c55e;
    border: 2.5px solid #ffffff;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.8);
    animation: kaptenPulse 2s infinite ease-in-out;
}

@keyframes kaptenPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 8px rgba(34, 197, 94, 0.8);
    }
    50% {
        transform: scale(1.15);
        box-shadow: 0 0 14px rgba(34, 197, 94, 1);
    }
}

/* Proactive Speech Bubble */
.kapten-speech-bubble {
    pointer-events: none;
    width: 320px;
    max-width: calc(100vw - 48px);
    background: #ffffff;
    border: 1.5px solid #bfdbfe;
    border-radius: 18px;
    padding: 14px 16px;
    box-shadow: 0 14px 34px -4px rgba(15, 23, 42, 0.16), 0 4px 12px rgba(37, 99, 235, 0.1);
    margin-bottom: 14px;
    opacity: 0;
    transform: translateY(14px) scale(0.94);
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    user-select: none;
}

.kapten-speech-bubble.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.kapten-speech-bubble::after {
    content: "";
    position: absolute;
    bottom: -8px;
    right: 24px;
    width: 14px;
    height: 14px;
    background: #ffffff;
    border-right: 1.5px solid #bfdbfe;
    border-bottom: 1.5px solid #bfdbfe;
    transform: rotate(45deg);
}

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

.kapten-bubble-badge {
    font-size: 10px;
    font-weight: 800;
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
    padding: 2px 8px;
    border-radius: 12px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.kapten-bubble-close {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    transition: color 0.15s;
}

.kapten-bubble-close:hover {
    color: #0f172a;
}

.kapten-bubble-title {
    font-size: 13.5px;
    font-weight: 800;
    color: #0f172a;
    margin: 4px 0 3px 0;
}

.kapten-bubble-text {
    font-size: 12px;
    color: #475569;
    line-height: 1.45;
    margin: 0 0 10px 0;
}

.kapten-bubble-chips {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.kapten-chip-btn {
    text-align: left;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 7px 11px;
    font-size: 11.5px;
    font-weight: 600;
    color: #1e293b;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.kapten-chip-btn:hover {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #1d4ed8;
    transform: translateX(2px);
}

.kapten-bubble-chat-icon-btn {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.kapten-bubble-chat-icon-btn:hover {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
}

.kapten-bubble-cycle-btn {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #475569;
    font-size: 10.5px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.kapten-bubble-cycle-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
    border-color: #94a3b8;
}

.kapten-quick-reply-box {
    margin-top: 10px;
    display: flex;
    gap: 6px;
    align-items: center;
}

.kapten-quick-reply-input {
    flex: 1;
    background: #f8fafc;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 11.5px;
    color: #1e293b;
    outline: none;
    transition: all 0.2s ease;
    font-family: inherit;
}

.kapten-quick-reply-input:focus {
    background: #ffffff;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.kapten-quick-send-btn {
    background: #2563eb;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.kapten-quick-send-btn:hover {
    background: #1d4ed8;
    transform: scale(1.05);
}

.kapten-mini-prompt {
    position: absolute;
    bottom: 12px;
    right: 74px;
    background: #ffffff;
    border: 1.5px solid #bfdbfe;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 11.5px;
    font-weight: 700;
    color: #1d4ed8;
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.18);
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    white-space: nowrap;
    opacity: 0;
    transform: translateX(10px) scale(0.95);
    pointer-events: none;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.kapten-mini-prompt.visible {
    opacity: 1;
    transform: translateX(0) scale(1);
    pointer-events: auto;
}

.kapten-mini-prompt:hover {
    background: #eff6ff;
    border-color: #93c5fd;
    transform: translateX(-2px) scale(1.03);
}

@keyframes kaptenWave {
    0%, 100% { transform: scale(1) rotate(0deg); }
    20% { transform: scale(1.08) rotate(-6deg); }
    40% { transform: scale(1.08) rotate(6deg); }
    60% { transform: scale(1.08) rotate(-4deg); }
    80% { transform: scale(1.08) rotate(2deg); }
}

.kapten-waving {
    animation: kaptenWave 1.2s ease-in-out;
}

.kapten-bubble-footer {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px dashed #e2e8f0;
}

.kapten-bubble-chat-cta {
    width: 100%;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    border: none;
    border-radius: 9px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(37, 99, 235, 0.25);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.kapten-bubble-chat-cta:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(37, 99, 235, 0.35);
}

.kapten-cta-arrow {
    margin-left: auto;
    font-size: 13px;
    transition: transform 0.2s ease;
}

.kapten-bubble-chat-cta:hover .kapten-cta-arrow {
    transform: translateX(3px);
}

/* Interactive Chat Drawer */
.kapten-chat-drawer {
    position: fixed;
    bottom: 96px;
    right: 28px;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 520px;
    max-height: calc(100vh - 120px);
    background: #ffffff;
    border: 1.5px solid #bfdbfe;
    border-radius: 20px;
    box-shadow: 0 18px 44px -6px rgba(15, 23, 42, 0.22), 0 0 0 1px rgba(37, 99, 235, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(24px) scale(0.95);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1000;
}

.kapten-chat-drawer.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.kapten-drawer-header {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    color: #ffffff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.kapten-drawer-profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

.kapten-drawer-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.8);
    object-fit: cover;
}

.kapten-drawer-name {
    font-size: 14px;
    font-weight: 800;
    line-height: 1.2;
}

.kapten-drawer-status {
    font-size: 11px;
    color: #bfdbfe;
    display: flex;
    align-items: center;
    gap: 5px;
}

.kapten-drawer-close {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #ffffff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.kapten-drawer-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.kapten-chat-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f8fafc;
    scroll-behavior: smooth;
}

.kapten-msg-row {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

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

.kapten-msg-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    margin-top: 2px;
    border: 1px solid #bfdbfe;
}

.kapten-msg-bubble {
    padding: 10px 14px;
    font-size: 12.5px;
    line-height: 1.5;
    word-break: break-word;
}

.kapten-msg-bubble.copilot {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px 16px 16px 4px;
    color: #1e293b;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    max-width: 88%;
}

.kapten-msg-bubble.user {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    border-radius: 16px 16px 4px 16px;
    max-width: 88%;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.kapten-msg-bubble.typing {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 14px;
}

.typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #94a3b8;
    animation: typingBounce 1.2s infinite ease-in-out;
}

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

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-4px); }
}

.kapten-chat-input-box {
    padding: 12px 14px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.kapten-input-field {
    flex: 1;
    border: 1.5px solid #cbd5e1;
    border-radius: 24px;
    padding: 8px 14px;
    font-size: 12.5px;
    outline: none;
    transition: all 0.2s ease;
    background: #f8fafc;
}

.kapten-input-field:focus {
    border-color: #3b82f6;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.kapten-send-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.kapten-send-btn:hover {
    transform: scale(1.06);
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
}

.kapten-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ==========================================================================
   Tes Cepat 10 Menit (Pedoman E-Book Bab 1 Hlm 20-24) Diagnostik Pintu
   ========================================================================== */

.btn-fast-diagnostic {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
    border: 1.5px solid #c4b5fd;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.12);
    text-decoration: none;
}

.btn-fast-diagnostic:hover {
    background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
    border-color: #a78bfa;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(139, 92, 246, 0.22);
}

.btn-diag-inner-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.diagnostic-btn-title {
    font-size: 12.5px;
    font-weight: 800;
    color: #1e1b4b;
    line-height: 1.25;
}

.diagnostic-btn-subtitle {
    font-size: 11px;
    color: #4f46e5;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}

.diagnostic-btn-arrow {
    font-size: 18px;
    color: #6366f1;
    font-weight: bold;
    margin-left: 6px;
    transition: transform 0.2s ease;
}

.btn-fast-diagnostic:hover .diagnostic-btn-arrow {
    transform: translateX(3px);
}

.diagnostic-btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: #ffffff;
    border: 1px solid #ddd6fe;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    box-shadow: 0 2px 5px rgba(139, 92, 246, 0.15);
}

.badge-ebook-source {
    font-size: 9.5px;
    font-weight: 700;
    background: #e0e7ff;
    color: #4338ca;
    padding: 1px 6px;
    border-radius: 8px;
    letter-spacing: 0.2px;
}

@media (max-width: 900px) {
    .welcome-header-content {
        flex-direction: column;
        align-items: stretch;
    }
    .btn-fast-diagnostic {
        width: 100%;
        box-sizing: border-box;
    }
}

/* Wide 2-Column Diagnostic Modal Layout */
.diagnostic-modal-wide {
    max-width: 1060px !important;
    width: 95vw !important;
}

.diagnostic-grid-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 840px) {
    .diagnostic-grid-layout {
        grid-template-columns: 1.18fr 0.92fr;
        gap: 22px;
        align-items: stretch;
    }
}

.diagnostic-col-questions {
    min-width: 0;
}

.diagnostic-col-results {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.diagnostic-result-box-wrap {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Kuesioner Items */
.diagnostic-items-container {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.diagnostic-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    padding: 7px 11px;
    transition: all 0.2s ease;
}

.diagnostic-item-row.row-ya {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.diagnostic-item-row.row-belum {
    background: #ffffff;
    border-color: #e2e8f0;
}

.diagnostic-item-num {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #475569;
    font-size: 11px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.diagnostic-item-row.row-ya .diagnostic-item-num {
    background: #10b981;
    color: #ffffff;
}

.diagnostic-item-text {
    flex: 1;
    font-size: 12px;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.35;
}

.diagnostic-btn-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.diagnostic-toggle-btn {
    border: 1.5px solid #cbd5e1;
    background: #ffffff;
    color: #64748b;
    font-size: 11.5px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.diagnostic-toggle-btn:hover {
    border-color: #94a3b8;
    color: #1e293b;
}

.diagnostic-toggle-btn.active-ya {
    border-color: #10b981;
    background: #10b981;
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}

.diagnostic-toggle-btn.active-belum {
    border-color: #f59e0b;
    background: #fef3c7;
    color: #92400e;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.18);
}

/* Real-Time Result Cards */
.diagnostic-result-card {
    border-radius: 14px;
    padding: 16px 18px;
    position: relative;
    animation: diagFadeIn 0.3s ease;
    height: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

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

.diagnostic-result-card.rule-ab {
    background: linear-gradient(135deg, #fffbeb 0%, #faf5ff 100%);
    border: 1.5px solid #fde68a;
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.1);
}

.diagnostic-result-card.rule-c {
    background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
    border: 1.5px solid #bfdbfe;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.1);
}

.diagnostic-result-card.rule-d {
    background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 100%);
    border: 1.5px solid #a7f3d0;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.1);
}

.diagnostic-badge-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.diagnostic-route-tag {
    font-size: 10.5px;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 14px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.diagnostic-route-tag.tag-ab {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.diagnostic-route-tag.tag-c {
    background: #dbeafe;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.diagnostic-route-tag.tag-d {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #a7f3d0;
}

.diagnostic-score-tag {
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
}

.diagnostic-rec-title {
    font-size: 14.5px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 6px 0;
}

.diagnostic-rec-desc {
    font-size: 12px;
    color: #475569;
    line-height: 1.5;
    margin: 0 0 12px 0;
}

.diagnostic-action-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: auto;
    padding-top: 8px;
}

@media (min-width: 1020px) {
    .diagnostic-action-buttons {
        flex-direction: row;
    }
}

.btn-diag-apply {
    flex: 1;
    min-width: 130px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 12px;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    text-align: center;
}

.btn-diag-pintu1 {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.btn-diag-pintu1:hover {
    background: linear-gradient(135deg, #6d28d9 0%, #5b21b6 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(124, 58, 237, 0.4);
}

.btn-diag-pintu2 {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

.btn-diag-pintu2:hover {
    background: linear-gradient(135deg, #047857 0%, #065f46 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(5, 150, 105, 0.4);
}

.btn-diag-pintu3 {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-diag-pintu3:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

.btn-diag-pintu4 {
    background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(234, 88, 12, 0.3);
}

.btn-diag-pintu4:hover {
    background: linear-gradient(135deg, #c2410c 0%, #9a3412 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(234, 88, 12, 0.4);
}

.diagnostic-recommendation-tag {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #7c3aed 0%, #2563eb 100%);
    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
    padding: 3px 12px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4);
    letter-spacing: 0.3px;
    white-space: nowrap;
    z-index: 10;
    animation: diagTagPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes diagTagPop {
    from { transform: translateX(-50%) scale(0.8); opacity: 0; }
    to { transform: translateX(-50%) scale(1); opacity: 1; }
}

/* ==========================================================================
   Ruang Kerja 7 Folder (E-Book TUNTAS-24 Sub-bab 1.3)
   ========================================================================== */

.hero-workspace-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 16px;
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 9px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.hero-workspace-btn:hover {
    background: rgba(255, 255, 255, 0.26);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.workspace-quote-banner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #fefce8 0%, #fef9c3 100%);
    border: 1px solid #fef08a;
    border-radius: 12px;
    margin-bottom: 14px;
}

.workspace-quote-icon {
    font-size: 20px;
    line-height: 1;
    flex-shrink: 0;
}

.workspace-quote-text {
    font-size: 12.5px;
    color: #854d0e;
    line-height: 1.5;
}

.workspace-action-deck {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.workspace-action-info {
    flex: 1 1 300px;
}

.workspace-action-btns {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-workspace-download {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff !important;
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    transition: all 0.2s ease;
}

.btn-workspace-download:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

.btn-workspace-copy {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 14px;
    background: #ffffff;
    color: #334155;
    border: 1px solid #cbd5e1;
    font-size: 12px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-workspace-copy:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #0f172a;
    transform: translateY(-1px);
}

.workspace-folders-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}

.workspace-folder-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.2s ease;
}

.workspace-folder-card:hover {
    border-color: #93c5fd;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08);
    transform: translateY(-1px);
}

.workspace-folder-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.workspace-folder-tag {
    background: #eff6ff;
    color: #2563eb;
    font-size: 10.5px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 5px;
    border: 1px solid #bfdbfe;
    font-family: monospace;
}

.workspace-folder-name {
    font-size: 12.5px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.2px;
}

.workspace-folder-desc {
    font-size: 11.5px;
    color: #64748b;
    line-height: 1.45;
    margin: 0 0 10px 0;
    flex-grow: 1;
}

.workspace-folder-footer {
    border-top: 1px dashed #f1f5f9;
    padding-top: 8px;
}

.workspace-module-link {
    font-size: 11px;
    font-weight: 600;
    color: #2563eb;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color 0.15s ease;
}

.workspace-module-link:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.workspace-naming-section {
    background: #fafafa;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 16px;
}

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

.workspace-naming-pattern {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.workspace-pattern-code {
    font-size: 12px;
    font-weight: 700;
    color: #0f172a;
    background: #ffffff;
    padding: 3px 8px;
    border-radius: 5px;
    border: 1px solid #cbd5e1;
    word-break: break-all;
}

.workspace-examples-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.workspace-example-box {
    border-radius: 10px;
    padding: 10px 12px;
}

.example-correct {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
}

.example-wrong {
    background: #fff1f2;
    border: 1px solid #fecdd3;
}

.example-title {
    font-size: 11.5px;
    font-weight: 700;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.example-list {
    margin: 0;
    padding-left: 18px;
    font-size: 11px;
    line-height: 1.5;
    color: #334155;
}

.example-list li {
    margin-bottom: 3px;
}

.workspace-terminal-box {
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: 12px;
    padding: 12px 16px;
}

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

.workspace-terminal-tabs {
    display: flex;
    gap: 4px;
}

.btn-terminal-tab {
    background: #1e293b;
    color: #94a3b8;
    border: 1px solid #334155;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-terminal-tab.active, .btn-terminal-tab:hover {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}

.workspace-terminal-code-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: #020617;
    border: 1px solid #1e293b;
    border-radius: 8px;
    padding: 8px 12px;
}

#workspaceTerminalCode {
    margin: 0;
    font-size: 11.5px;
    color: #38bdf8;
    font-family: Consolas, Monaco, monospace;
    white-space: pre-wrap;
    word-break: break-all;
    flex: 1;
}

.btn-terminal-copy {
    background: #1e293b;
    color: #e2e8f0;
    border: 1px solid #334155;
    padding: 5px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.btn-terminal-copy:hover {
    background: #334155;
    color: #ffffff;
}

@media (max-width: 640px) {
    .workspace-folders-grid {
        grid-template-columns: 1fr;
    }
    .workspace-examples-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Dedicated Projects Hub (/projects) & Hero Switcher Pill
   ========================================================================== */

.hero-project-switcher-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff !important;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.2px;
    backdrop-filter: blur(8px);
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.hero-project-switcher-pill:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.hero-pill-arrow {
    font-size: 12px;
    opacity: 0.8;
    transition: transform 0.2s ease;
}

.hero-project-switcher-pill:hover .hero-pill-arrow {
    transform: translateX(2px);
}

.projects-hub-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.projects-tag-line {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #eff6ff 0%, #e0f2fe 100%);
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    font-size: 11px;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: 20px;
    letter-spacing: 0.6px;
    margin-bottom: 8px;
    box-shadow: 0 1px 4px rgba(37, 99, 235, 0.08);
}

.projects-main-title {
    font-size: 24px;
    font-weight: 900;
    color: #0f172a;
    margin: 0 0 6px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: -0.5px;
}

.projects-subtitle {
    font-size: 13.5px;
    color: #64748b;
    margin: 0;
    line-height: 1.55;
    max-width: 680px;
}

.projects-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-workspace-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: #ffffff;
    color: #1e293b !important;
    text-decoration: none;
    border: 1.5px solid #cbd5e1;
    border-radius: 11px;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-workspace-link:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #0f172a !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

.btn-new-project {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 55%, #0284c7 100%);
    color: #ffffff !important;
    text-decoration: none;
    border-radius: 11px;
    font-size: 13px;
    font-weight: 800;
    border: 1px solid #60a5fa;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-new-project:hover {
    background: linear-gradient(135deg, #1e40af 0%, #1d4ed8 55%, #0369a1 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.48), 0 0 16px rgba(56, 189, 248, 0.4);
    color: #ffffff !important;
}

/* Quick Stats Deck */
.projects-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.stat-card-project {
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 16px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
    transition: all 0.25s ease;
}

.stat-card-project:hover {
    border-color: #cbd5e1;
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.07);
}

.stat-icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.stat-label {
    font-size: 11.5px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 3px;
}

.stat-val {
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.3px;
}

/* Filter & Search Bar */
.projects-filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 16px;
    padding: 12px 20px;
    margin-bottom: 22px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
    flex-wrap: wrap;
}

.projects-search-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 360px;
}

.search-icon {
    font-size: 16px;
    color: #64748b;
}

.projects-search-input {
    width: 100%;
    border: none;
    outline: none;
    font-size: 13.5px;
    color: #0f172a;
    background: transparent;
    font-weight: 500;
}

.projects-search-input::placeholder {
    color: #94a3b8;
}

.projects-filter-count {
    font-size: 12.5px;
    color: #64748b;
    white-space: nowrap;
    font-weight: 500;
}

.projects-filter-count strong {
    color: #1d4ed8;
    font-weight: 800;
}

/* Project Cards Grid */
.projects-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(370px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

/* Base Project Card */
.project-card-full {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 20px;
    padding: 22px 22px 20px 22px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 4px 20px -4px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.project-card-full:hover {
    border-color: #93c5fd;
    transform: translateY(-4px);
    box-shadow: 0 18px 36px -8px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(59, 130, 246, 0.25);
}

/* Active Project Card (The Crown Jewel) */
.project-card-active {
    border-color: #38bdf8 !important;
    background: linear-gradient(175deg, #ffffff 0%, #f0fdfa 45%, #eff6ff 100%) !important;
    box-shadow: 0 14px 40px -8px rgba(37, 99, 235, 0.18), 0 0 0 1.5px rgba(56, 189, 248, 0.45) !important;
}

.project-card-top-accent {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #38bdf8 0%, #2563eb 50%, #10b981 100%);
}

.project-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.project-active-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    color: #065f46;
    border: 1px solid #6ee7b7;
    font-size: 10.5px;
    font-weight: 800;
    padding: 3.5px 9px;
    border-radius: 20px;
    letter-spacing: 0.4px;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.2);
}

.project-draft-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    font-size: 10.5px;
    font-weight: 700;
    padding: 3.5px 9px;
    border-radius: 20px;
}

.project-method-tag {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    font-size: 10.5px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
}

.project-method-tag.tag-rnd {
    background: #eef2ff;
    color: #4338ca;
    border-color: #c7d2fe;
}

.project-method-tag.tag-kualitatif {
    background: #faf5ff;
    color: #6b21a8;
    border-color: #e9d5ff;
}

.project-level-tag {
    background: #fdf4ff;
    color: #a21caf;
    border: 1px solid #f5d0fe;
    font-size: 10.5px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
}

.project-date-tag {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 500;
}

/* Title & Inline Edit */
.project-title-wrap {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin: 0 0 14px 0;
}

.project-title {
    font-size: 16px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.45;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    letter-spacing: -0.2px;
}

.btn-card-rename-inline {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #64748b;
    padding: 4px 6px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-top: 1px;
}

.btn-card-rename-inline:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
    transform: scale(1.1);
}

/* Academic Metadata Chips */
.project-meta-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 16px;
}

.meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    padding: 4px 9px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.15s ease;
}

.meta-chip-campus {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    color: #0369a1;
    font-weight: 600;
}

.meta-chip-faculty {
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    color: #4338ca;
    font-weight: 600;
}

.meta-chip-author {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #334155;
}

.meta-chip-supervisor {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #15803d;
    font-weight: 600;
}

/* Progress Bar Section */
.project-progress-section {
    background: rgba(248, 250, 252, 0.9);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 18px;
}

.project-progress-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.progress-step-pill {
    font-size: 11.5px;
    color: #64748b;
    font-weight: 600;
}

.progress-step-pill strong {
    color: #1e293b;
    font-weight: 800;
}

.progress-pct-pill {
    font-size: 12px;
    font-weight: 800;
    color: #475569;
}

.progress-pct-pill.pct-active {
    color: #1d4ed8;
}

.project-progress-track {
    height: 7px;
    background: #e2e8f0;
    border-radius: 9999px;
    overflow: hidden;
}

.project-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #94a3b8 0%, #64748b 100%);
    border-radius: 9999px;
    transition: width 0.4s ease;
}

.progress-active {
    background: linear-gradient(90deg, #38bdf8 0%, #2563eb 100%) !important;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
}

/* Tiered Action Deck */
.project-card-actions-deck {
    display: flex;
    flex-direction: column;
    gap: 9px;
    padding-top: 14px;
    border-top: 1px solid rgba(226, 232, 240, 0.8);
}

/* Primary Full-Width CTA */
.btn-card-primary-cta {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 16px;
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 55%, #0284c7 100%);
    color: #ffffff !important;
    font-size: 13px;
    font-weight: 800;
    border-radius: 12px;
    border: 1px solid #60a5fa;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.22s ease;
    box-sizing: border-box;
}

.btn-card-primary-cta:hover {
    box-shadow: 0 6px 22px rgba(37, 99, 235, 0.5), 0 0 14px rgba(56, 189, 248, 0.4);
    transform: translateY(-1.5px);
    color: #ffffff !important;
}

.btn-card-primary-cta .btn-cta-arrow,
.btn-card-switch-cta .btn-cta-arrow {
    font-size: 15px;
    font-weight: 800;
    transition: transform 0.2s ease;
}

.btn-card-primary-cta:hover .btn-cta-arrow,
.btn-card-switch-cta:hover .btn-cta-arrow {
    transform: translateX(4px);
}

.btn-card-switch-cta {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    color: #1d4ed8 !important;
    font-size: 13px;
    font-weight: 700;
    border-radius: 12px;
    border: 1.5px solid #bfdbfe;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.08);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.22s ease;
    box-sizing: border-box;
}

.btn-card-switch-cta:hover {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-color: #60a5fa;
    color: #1e40af !important;
    transform: translateY(-1.5px);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.2);
}

/* Secondary Quick Utilities Toolbar */
.project-card-toolbar {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 38px;
    gap: 6px;
    align-items: center;
}

.btn-tool-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 7px 6px;
    font-size: 11.5px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 9px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #475569 !important;
    transition: all 0.18s ease;
    cursor: pointer;
    white-space: nowrap;
    box-sizing: border-box;
}

.btn-tool-item:hover {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #0f172a !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.btn-tool-rename:hover {
    background: #eff6ff !important;
    border-color: #bfdbfe !important;
    color: #1d4ed8 !important;
}

.btn-tool-delete {
    color: #ef4444 !important;
    border-color: #fee2e2;
    background: #fff5f5;
    padding: 7px 0;
}

.btn-tool-delete:hover {
    background: #fee2e2 !important;
    border-color: #fca5a5 !important;
    color: #b91c1c !important;
}

.projects-empty-state {
    text-align: center;
    padding: 64px 24px;
    background: #ffffff;
    border: 2px dashed #cbd5e1;
    border-radius: 20px;
    margin: 24px 0;
}

.empty-icon {
    font-size: 52px;
    margin-bottom: 14px;
}

@media (max-width: 768px) {
    .projects-stats-grid {
        grid-template-columns: 1fr;
    }
    .projects-cards-grid {
        grid-template-columns: 1fr;
    }
    .projects-hub-header {
        flex-direction: column;
    }
}

/* ==========================================================================
   Matrix AI Gemini Helpers & Trays
   ========================================================================== */
.ai-matrix-row-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #4f46e5;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
}

.ai-matrix-row-btn:hover {
    background: #eef2ff;
    border-color: #c7d2fe;
    color: #4338ca;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.15);
    transform: translateY(-1px);
}

.ai-matrix-row-btn:active {
    transform: translateY(0);
}

.ai-matrix-tray {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 14px;
    margin-top: 10px;
    box-shadow: 0 6px 18px -4px rgba(15, 23, 42, 0.08);
    animation: rpTraySlideDown 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.ai-matrix-tray-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}

.ai-matrix-tray-title {
    font-size: 12px;
    font-weight: 800;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ai-matrix-tray-close {
    background: none;
    border: none;
    font-size: 16px;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.ai-matrix-tray-close:hover {
    color: #0f172a;
    background: #e2e8f0;
}

.ai-matrix-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 10px;
}

.ai-matrix-option-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
    transition: all 0.2s ease;
}

.ai-matrix-option-card:hover {
    border-color: #818cf8;
    box-shadow: 0 6px 16px -2px rgba(99, 102, 241, 0.12);
    transform: translateY(-2px);
}

.ai-matrix-option-badge {
    display: inline-block;
    background: #eef2ff;
    color: #4f46e5;
    border: 1px solid #e0e7ff;
    font-size: 10.5px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    margin-bottom: 8px;
}

.ai-matrix-option-val {
    font-size: 12.5px;
    color: #1e293b;
    line-height: 1.45;
    margin-bottom: 8px;
    font-weight: 500;
}

.ai-matrix-option-reason {
    font-size: 11px;
    color: #64748b;
    line-height: 1.4;
    margin-bottom: 10px;
    background: #f8fafc;
    padding: 6px 8px;
    border-radius: 6px;
    border-left: 3px solid #6366f1;
}

.ai-matrix-option-btn {
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: all 0.2s ease;
    width: 100%;
}

.ai-matrix-option-btn:hover {
    background: linear-gradient(135deg, #4338ca 0%, #4f46e5 100%);
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.25);
}

@keyframes rpInputFlash {
    0% {
        border-color: #10b981;
        box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.35);
        background-color: #f0fdf4;
    }
    70% {
        border-color: #10b981;
        box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
        background-color: #f0fdf4;
    }
    100% {
        border-color: var(--border-color, #cbd5e1);
        box-shadow: none;
        background-color: #ffffff;
    }
}

.matrix-input-highlight {
    animation: rpInputFlash 2.5s ease forwards;
}

/* Dynamic RQ and Objectives Matrix Controls */
.rq-pill-btn {
    flex: 1;
    padding: 5px 0;
    font-size: 11.5px;
    font-weight: 700;
    text-align: center;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #475569;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.rq-pill-btn:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #0f172a;
}

.rq-pill-btn.active {
    background: #2563eb !important;
    border-color: #1d4ed8 !important;
    color: #ffffff !important;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3) !important;
}

.sync-obj-btn {
    width: 100%;
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 11.5px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(22, 163, 74, 0.25);
    transition: all 0.15s ease;
}

.sync-obj-btn:hover {
    background: linear-gradient(135deg, #15803d 0%, #166534 100%);
    box-shadow: 0 4px 8px rgba(22, 163, 74, 0.35);
    transform: translateY(-1px);
}

.sync-obj-btn:active {
    transform: translateY(0);
}

/* ==========================================================================
   SUBBAB GEMINI AI STYLING (PER-SUBBAB AI FEATURES)
   ========================================================================== */

/* Subbab List AI Quick Badge Button */
.subbab-link-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.btn-subbab-ai-badge {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.1) 0%, rgba(37, 99, 235, 0.14) 100%);
    color: #4338ca;
    border: 1px solid rgba(99, 102, 241, 0.35);
    border-radius: 9999px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    line-height: 1.3;
}

.btn-subbab-ai-badge:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #2563eb 100%);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.35);
    transform: translateY(-1px);
}

/* Header Editor AI Draft Button */
.btn-subbab-ai-header {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #4f46e5 0%, #2563eb 100%);
    color: #ffffff;
    border: none;
    border-radius: 7px;
    padding: 6px 13px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.28);
    transition: all 0.2s ease;
}

.btn-subbab-ai-header:hover {
    background: linear-gradient(135deg, #4338ca 0%, #1d4ed8 100%);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
    transform: translateY(-1px);
}

.btn-subbab-ai-header .ai-sparkle-icon {
    font-size: 13px;
    animation: sparklePulse 2.4s infinite ease-in-out;
}

@keyframes sparklePulse {
    0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.9; }
    50% { transform: scale(1.25) rotate(15deg); opacity: 1; }
}

/* Empty State AI Banner in Editor */
.editor-empty-ai-card {
    background: linear-gradient(135deg, #ffffff 0%, #f0f7ff 100%);
    border: 1.5px solid #bfdbfe;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 14px;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.08);
    position: relative;
    overflow: hidden;
    transition: all 0.25s ease;
}

.editor-empty-ai-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #3b82f6 0%, #6366f1 100%);
}

.empty-ai-card-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    justify-content: space-between;
    flex-wrap: wrap;
}

.empty-ai-card-icon-wrap {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #bfdbfe;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.empty-ai-card-content {
    flex: 1 1 320px;
    min-width: 0;
}

.empty-ai-badge-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.empty-ai-subbab-badge {
    font-size: 11px;
    font-weight: 700;
    color: #1e40af;
    background: #e0e7ff;
    padding: 2px 7px;
    border-radius: 4px;
}

.empty-ai-card-title {
    margin: 0 0 4px 0;
    font-size: 14.5px;
    font-weight: 700;
    color: #1e293b;
}

.empty-ai-card-text {
    margin: 0;
    font-size: 12.5px;
    color: #475569;
    line-height: 1.45;
}

.empty-ai-card-action {
    flex-shrink: 0;
}

.btn-empty-ai-trigger {
    background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 9px 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(37, 99, 235, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: all 0.2s ease;
}

.btn-empty-ai-trigger:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #4338ca 100%);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
    transform: translateY(-1px);
}

/* Modal Subbab AI Elements */
.subbab-ai-modal-title-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.modal-header-badge-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
}

.subbab-ai-loading-state {
    text-align: center;
    padding: 48px 20px;
}

.ai-spinner-ring {
    width: 48px;
    height: 48px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #4f46e5;
    border-radius: 50%;
    margin: 0 auto;
    animation: rpSpin 0.9s linear infinite;
}

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

.subbab-ai-instruction-bar {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 14px;
}

.subbab-ai-label {
    display: block;
    font-size: 11.5px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
}

.subbab-ai-draft-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.subbab-ai-draft-title {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.subbab-ai-word-estimate {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    background: #f1f5f9;
    padding: 2px 7px;
    border-radius: 9999px;
}

.btn-text-action {
    background: transparent;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 11.5px;
    color: #475569;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
}

.btn-text-action:hover {
    background: #ffffff;
    border-color: #94a3b8;
    color: #0f172a;
}

/* ==========================================================================
   GEMINI AI SUBBAB DRAFT GENERATOR - ULTRA-PREMIUM CYBER-ACADEMIC DARK GLASS
   ========================================================================== */

#subbabAiModal.modal-backdrop.active,
#subbabAiModal.active {
    display: flex !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(2, 6, 23, 0.86) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 99999 !important;
    padding: 20px !important;
    box-sizing: border-box !important;
}

#subbabAiModal .modal-box-wide,
#subbabAiModal .subbab-ai-modal-box {
    max-width: 1260px !important;
    width: 95vw !important;
    max-height: 93vh !important;
    background: linear-gradient(165deg, #090e1a 0%, #0d1628 50%, #080c16 100%) !important;
    border-radius: 22px !important;
    border: 1px solid rgba(56, 189, 248, 0.28) !important;
    box-shadow: 0 35px 100px -15px rgba(0, 0, 0, 0.95), 0 0 50px -10px rgba(56, 189, 248, 0.18) !important;
    color: #f8fafc !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    animation: subbabAiBoxEnter 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes subbabAiBoxEnter {
    from { opacity: 0; transform: scale(0.96) translateY(12px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Modal Header */
#subbabAiModal .subbab-ai-modal-header,
#subbabAiModal .modal-header,
.subbab-ai-modal-header {
    padding: 22px 30px !important;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.98) 0%, rgba(30, 41, 59, 0.85) 100%) !important;
    border-bottom: 1px solid rgba(56, 189, 248, 0.22) !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    gap: 16px !important;
    position: relative !important;
}

.subbab-ai-modal-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 30px;
    right: 30px;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(56, 189, 248, 0.45) 50%, transparent 100%);
}

.subbab-ai-modal-title-group {
    flex: 1;
    min-width: 0;
}

.subbab-pill-code {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(30, 41, 59, 0.85);
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: #38bdf8;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 999px;
    letter-spacing: 0.2px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.subbab-pill-ai {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.22) 0%, rgba(168, 85, 247, 0.22) 100%);
    border: 1px solid rgba(168, 85, 247, 0.45);
    color: #c084fc;
    font-size: 11px;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: 999px;
    letter-spacing: 0.3px;
    box-shadow: 0 0 14px rgba(168, 85, 247, 0.25);
}

.subbab-pill-context {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(16, 185, 129, 0.16);
    border: 1px solid rgba(52, 211, 153, 0.4);
    color: #34d399;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 999px;
}

.subbab-ai-modal-title {
    font-size: 18.5px !important;
    font-weight: 700 !important;
    color: #f8fafc !important;
    letter-spacing: -0.01em !important;
    margin: 0 0 5px 0 !important;
    text-shadow: 0 0 14px rgba(56, 189, 248, 0.25);
}

.subbab-ai-modal-subtext {
    font-size: 12.5px !important;
    color: #94a3b8 !important;
    margin: 0 !important;
    line-height: 1.45;
}

.subbab-ai-modal-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #94a3b8;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.subbab-ai-modal-close:hover {
    background: rgba(239, 68, 68, 0.22);
    border-color: #ef4444;
    color: #fca5a5;
    transform: rotate(90deg);
}

/* Modal Body */
#subbabAiModal .modal-body {
    padding: 22px 30px !important;
    background: transparent !important;
    overflow-y: auto !important;
    max-height: calc(93vh - 150px) !important;
}

#subbabAiModal .modal-body::-webkit-scrollbar {
    width: 6px;
}
#subbabAiModal .modal-body::-webkit-scrollbar-track {
    background: #090e1a;
}
#subbabAiModal .modal-body::-webkit-scrollbar-thumb {
    background: #1e293b;
    border-radius: 4px;
}

/* Sequence Alert */
.subbab-ai-sequence-alert {
    margin-bottom: 16px;
}

.ai-seq-alert-inner {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.12) 0%, rgba(217, 119, 6, 0.08) 100%);
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fde68a;
    font-size: 12px;
    line-height: 1.5;
}

.ai-seq-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.ai-seq-link {
    color: #38bdf8;
    font-weight: 700;
    text-decoration: underline;
    margin-left: 6px;
}

/* ==========================================================================
   Loading State: AI Neural Holographic Core & Laser Progress
   ========================================================================== */
.subbab-ai-loading-state {
    padding: 6px 0;
    width: 100%;
    box-sizing: border-box;
}

.subbab-ai-progress-card {
    background: linear-gradient(160deg, rgba(15, 23, 42, 0.8) 0%, rgba(13, 22, 40, 0.65) 100%) !important;
    border: 1px solid rgba(56, 189, 248, 0.25) !important;
    border-radius: 18px !important;
    padding: 24px 28px !important;
    box-shadow: 0 15px 45px -10px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
    backdrop-filter: blur(10px) !important;
}

/* Gyroscopic Orbital Spinner */
.subbab-progress-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 22px;
}

.subbab-progress-spinner-wrap {
    position: relative;
    width: 66px;
    height: 66px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.subbab-ai-orbit-ring {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.subbab-ai-orbit-ring.ring-outer {
    width: 64px;
    height: 64px;
    border: 1.5px dashed rgba(56, 189, 248, 0.65);
    animation: spinRing 5s linear infinite;
}

.subbab-ai-orbit-ring.ring-middle {
    width: 48px;
    height: 48px;
    border: 1.5px solid rgba(168, 85, 247, 0.65);
    border-top-color: transparent;
    border-bottom-color: transparent;
    animation: spinRingReverse 3.5s linear infinite;
}

.subbab-ai-orbit-ring.ring-inner {
    width: 34px;
    height: 34px;
    border: 1px dotted rgba(52, 211, 153, 0.7);
    animation: spinRing 2s linear infinite;
}

.subbab-core-orb {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.4) 0%, rgba(99, 102, 241, 0.2) 80%);
    border: 1.5px solid rgba(56, 189, 248, 0.65);
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.subbab-sparkle-center {
    font-size: 15px;
    animation: subbabPulse 1.8s ease-in-out infinite;
}

.subbab-progress-heading-group {
    flex: 1;
    min-width: 0;
}

.subbab-progress-badge-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.subbab-ai-neural-pill {
    background: rgba(30, 41, 59, 0.85) !important;
    border: 1px solid rgba(56, 189, 248, 0.35) !important;
    color: #38bdf8 !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    padding: 3px 10px !important;
    border-radius: 999px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
}

.neural-pulse-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
    animation: enginePulse 1.5s infinite;
}

.subbab-ai-pipeline-pill {
    background: rgba(16, 185, 129, 0.16) !important;
    border: 1px solid rgba(52, 211, 153, 0.4) !important;
    color: #34d399 !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    padding: 3px 10px !important;
    border-radius: 999px !important;
}

.subbab-progress-title {
    margin: 0 0 5px 0 !important;
    font-size: 17.5px !important;
    font-weight: 700 !important;
    color: #f8fafc !important;
    letter-spacing: -0.01em !important;
    text-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

.subbab-progress-subtitle {
    margin: 0 !important;
    font-size: 12.5px !important;
    color: #94a3b8 !important;
    line-height: 1.45 !important;
}

/* High-Tech Laser Progress Bar Section */
.subbab-progress-section {
    background: rgba(9, 14, 26, 0.75) !important;
    border: 1px solid rgba(56, 189, 248, 0.2) !important;
    border-radius: 14px !important;
    padding: 15px 20px !important;
    margin-bottom: 18px !important;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4);
}

.subbab-progress-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.subbab-progress-stage {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #e2e8f0;
}

.subbab-progress-counter {
    display: flex;
    align-items: baseline;
    font-weight: 800;
    color: #38bdf8;
    text-shadow: 0 0 12px rgba(56, 189, 248, 0.6);
}

.subbab-percent-number {
    font-size: 24px;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

.subbab-percent-symbol {
    font-size: 14px;
    margin-left: 2px;
    color: #a855f7;
}

.subbab-progress-track {
    width: 100%;
    height: 11px;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 9999px;
    overflow: visible;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6);
}

.subbab-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #06b6d4 0%, #3b82f6 50%, #8b5cf6 100%);
    border-radius: 9999px;
    position: relative;
    transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.6);
}

.subbab-progress-bar.bar-error {
    background: linear-gradient(90deg, #dc2626 0%, #ef4444 100%) !important;
    box-shadow: 0 0 16px rgba(220, 38, 38, 0.6) !important;
}

.subbab-laser-head {
    position: absolute;
    right: -2px;
    top: -3px;
    bottom: -3px;
    width: 8px;
    border-radius: 999px;
    background: #ffffff;
    box-shadow: 0 0 12px 2px #38bdf8, 0 0 20px 4px #818cf8;
    z-index: 3;
}

/* Kapten Pilot Patience Cockpit Banner */
.subbab-ai-kapten-banner {
    background: linear-gradient(135deg, rgba(11, 19, 41, 0.95) 0%, rgba(15, 23, 42, 0.92) 100%) !important;
    border: 1.5px solid rgba(56, 189, 248, 0.35) !important;
    border-radius: 14px !important;
    padding: 14px 18px !important;
    margin-bottom: 16px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(56, 189, 248, 0.15) !important;
    display: flex !important;
    gap: 14px !important;
    align-items: flex-start !important;
}

.kapten-avatar-wrap {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #1e3a8a;
    border: 2px solid #38bdf8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
    box-shadow: 0 0 14px rgba(56, 189, 248, 0.45);
    position: relative;
}

.kapten-live-beacon {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    background: #10b981;
    border: 2px solid #0f172a;
    border-radius: 50%;
    box-shadow: 0 0 8px #10b981;
}

.kapten-content-col {
    flex: 1;
    min-width: 0;
}

.kapten-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    flex-wrap: wrap;
    gap: 6px;
}

.kapten-badge-group {
    display: flex;
    align-items: center;
    gap: 7px;
}

.kapten-title-label {
    font-weight: 800;
    font-size: 12.5px;
    color: #93c5fd;
    letter-spacing: 0.3px;
}

.kapten-pill-tag {
    font-size: 10px;
    background: rgba(30, 58, 138, 0.65);
    color: #60a5fa;
    padding: 2px 8px;
    border-radius: 8px;
    border: 1px solid rgba(59, 130, 246, 0.5);
    font-weight: 700;
}

.kapten-live-status {
    font-size: 11.5px;
    color: #38bdf8;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.kapten-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #38bdf8;
    box-shadow: 0 0 6px #38bdf8;
    animation: stageBlink 1.2s infinite;
}

.kapten-speech-text {
    margin: 0;
    font-size: 12.5px;
    color: #f1f5f9;
    line-height: 1.55;
    font-weight: 500;
}

.kapten-tip-row {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 11.5px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 6px;
}

.kapten-tip-icon {
    color: #fbbf24;
    flex-shrink: 0;
}

.kapten-tip-text {
    font-style: italic;
    color: #cbd5e1;
}

/* Activity Log Terminal */
.subbab-terminal-container {
    background: rgba(8, 12, 22, 0.95);
    border: 1px solid rgba(56, 189, 248, 0.22);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 12px 30px -5px rgba(0, 0, 0, 0.6);
}

.subbab-terminal-header {
    background: rgba(15, 23, 42, 0.95);
    border-bottom: 1px solid rgba(56, 189, 248, 0.15);
    padding: 11px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.terminal-dots {
    display: flex;
    gap: 6px;
}

.terminal-dots .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.terminal-dots .dot-red { background: #ef4444; box-shadow: 0 0 6px rgba(239, 68, 68, 0.5); }
.terminal-dots .dot-yellow { background: #f59e0b; box-shadow: 0 0 6px rgba(245, 158, 11, 0.5); }
.terminal-dots .dot-green { background: #10b981; box-shadow: 0 0 6px rgba(16, 185, 129, 0.5); }

.terminal-title {
    font-size: 11.5px;
    font-weight: 600;
    color: #38bdf8;
    letter-spacing: 0.03em;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.terminal-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    color: #38bdf8;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.terminal-status-pulse {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #38bdf8;
    box-shadow: 0 0 8px #38bdf8;
    animation: terminalBlink 1.2s infinite ease-in-out;
}

.subbab-terminal-body {
    padding: 16px 18px;
    max-height: 220px;
    min-height: 160px;
    overflow-y: auto;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
    line-height: 1.75;
    color: #e2e8f0;
    background: #060a12;
}

.subbab-terminal-body::-webkit-scrollbar {
    width: 6px;
}
.subbab-terminal-body::-webkit-scrollbar-track {
    background: #060a12;
}
.subbab-terminal-body::-webkit-scrollbar-thumb {
    background: #1e293b;
    border-radius: 4px;
}

.terminal-log-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 3.5px 0;
    transition: opacity 0.2s ease;
    animation: logFadeIn 0.3s ease forwards;
}

.terminal-log-row.log-pending {
    opacity: 0.45;
}

.terminal-log-row.log-active {
    color: #38bdf8;
    font-weight: 600;
    text-shadow: 0 0 8px rgba(56, 189, 248, 0.35);
}

.terminal-log-row.log-done {
    color: #cbd5e1;
}

.terminal-log-row.log-err {
    color: #f87171;
    font-weight: 600;
}

.terminal-log-time {
    color: #64748b;
    font-size: 11px;
    flex-shrink: 0;
    width: 46px;
}

.terminal-log-icon {
    flex-shrink: 0;
    width: 16px;
    text-align: center;
}

.terminal-log-icon.icon-done {
    color: #34d399;
    font-weight: bold;
}

.terminal-log-icon.icon-spin {
    display: inline-block;
    color: #38bdf8;
    animation: logSpin 0.8s linear infinite;
}

.terminal-log-icon.icon-wait {
    color: #64748b;
}

.terminal-log-icon.icon-err {
    color: #f87171;
    font-weight: bold;
}

.terminal-log-text {
    flex: 1;
    word-break: break-word;
}

.terminal-log-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 4px;
    margin-left: 8px;
    display: inline-block;
    vertical-align: middle;
}

.terminal-log-badge.badge-success {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.45);
}

.terminal-log-badge.badge-active {
    background: rgba(56, 189, 248, 0.2);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.45);
}

.terminal-log-badge.badge-err {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.45);
}

/* ==========================================================================
   Subbab AI: Result State & Cockpit Panels
   ========================================================================== */

/* Kapten Success Celebration Banner */
.subbab-ai-success-banner {
    background: linear-gradient(135deg, rgba(6, 78, 59, 0.85) 0%, rgba(6, 95, 70, 0.6) 100%) !important;
    border: 1.5px solid #10b981 !important;
    border-radius: 14px !important;
    padding: 16px 20px !important;
    margin-bottom: 18px !important;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.2) !important;
    position: relative !important;
    display: flex !important;
    align-items: flex-start !important;
    gap: 14px !important;
}

.success-avatar {
    background: #064e3b;
    border-color: #34d399;
    box-shadow: 0 0 14px rgba(52, 211, 153, 0.4);
}

.beacon-emerald {
    background: #34d399;
    box-shadow: 0 0 8px #34d399;
}

.kapten-success-heading {
    font-weight: 800;
    font-size: 13.5px;
    color: #ecfdf5;
    letter-spacing: 0.2px;
}

.kapten-metrics-pill {
    font-size: 11px;
    color: #34d399;
    font-weight: 700;
    background: rgba(6, 78, 59, 0.8);
    padding: 2px 9px;
    border-radius: 12px;
    border: 1px solid #10b981;
}

.kapten-success-speech {
    margin: 0;
    font-size: 12.5px;
    color: #d1fae5;
    line-height: 1.55;
    font-weight: 500;
}

.kapten-banner-close {
    background: none;
    border: none;
    color: #6ee7b7;
    font-size: 16px;
    cursor: pointer;
    padding: 2px 6px;
    line-height: 1;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.kapten-banner-close:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

/* Left Column: Focus Bar, Header, Paper Sheet & References */
.subbab-ai-instruction-bar {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 14px;
}

.subbab-ai-label {
    display: block;
    color: #93c5fd;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 6px;
}

#subbabAiCustomNotes {
    background: rgba(8, 12, 22, 0.85);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: #f8fafc;
    border-radius: 8px;
    padding: 8px 12px;
}

#subbabAiCustomNotes:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.35);
    outline: none;
}

#btnRegenerateSubbabAi {
    background: rgba(30, 41, 59, 0.85);
    border: 1px solid rgba(56, 189, 248, 0.4);
    color: #38bdf8;
    font-weight: 700;
    border-radius: 8px;
    transition: all 0.2s ease;
}

#btnRegenerateSubbabAi:hover {
    background: rgba(56, 189, 248, 0.2);
    color: #ffffff;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

.subbab-ai-draft-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.subbab-ai-draft-title {
    color: #f8fafc;
    font-weight: 700;
    font-size: 13.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.subbab-ai-word-estimate {
    background: rgba(30, 41, 59, 0.85);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: #38bdf8;
    padding: 2px 9px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
}

.btn-text-action {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #e2e8f0;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
}

.btn-text-action:hover {
    background: rgba(56, 189, 248, 0.2);
    border-color: #38bdf8;
    color: #ffffff;
}

/* Luxury Academic Paper Sheet */
.subbab-ai-paper-sheet {
    background: linear-gradient(170deg, #0b1120 0%, #0e172a 100%);
    border: 1.5px solid rgba(56, 189, 248, 0.22);
    border-radius: 12px;
    padding: 22px 26px;
    max-height: 420px;
    overflow-y: auto;
    font-family: 'Times New Roman', Georgia, serif;
    font-size: 15px;
    line-height: 1.85;
    color: #f1f5f9;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.4);
}

.subbab-ai-paper-sheet::-webkit-scrollbar {
    width: 6px;
}
.subbab-ai-paper-sheet::-webkit-scrollbar-track {
    background: #0b1120;
}
.subbab-ai-paper-sheet::-webkit-scrollbar-thumb {
    background: #1e293b;
    border-radius: 4px;
}

.subbab-draft-paragraph-box {
    position: relative;
    padding-left: 32px;
    margin-bottom: 16px;
}

.subbab-draft-paragraph-box:last-child {
    margin-bottom: 0;
}

.subbab-paragraph-num {
    position: absolute;
    left: 0;
    top: 2px;
    font-size: 11px;
    font-family: ui-monospace, SFMono-Regular, monospace;
    color: #38bdf8;
    font-weight: 800;
    background: rgba(56, 189, 248, 0.12);
    padding: 1px 5px;
    border-radius: 4px;
    border: 1px solid rgba(56, 189, 248, 0.25);
}

.subbab-paragraph-text {
    text-align: justify;
    text-indent: 28px;
}

.ai-citation-tag {
    background: rgba(245, 158, 11, 0.18);
    border: 1px solid rgba(245, 158, 11, 0.5);
    color: #fbbf24;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 11.5px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 6px;
    display: inline;
}

/* References Card */
#subbabAiModal .subbab-ai-references-card,
.subbab-ai-references-card {
    background: linear-gradient(160deg, rgba(15, 23, 42, 0.96) 0%, rgba(13, 22, 40, 0.92) 100%) !important;
    border: 1.5px solid rgba(56, 189, 248, 0.28) !important;
    border-radius: 14px !important;
    padding: 18px 20px !important;
    margin-top: 18px !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.45) !important;
}

#subbabAiModal .subbab-ai-references-header,
.subbab-ai-references-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 14px !important;
    padding-bottom: 12px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
}

#subbabAiModal .subbab-ai-references-header strong,
#subbabAiModal .subbab-ai-ref-header-title {
    color: #ffffff !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    letter-spacing: 0.2px !important;
    text-shadow: 0 0 12px rgba(56, 189, 248, 0.35) !important;
}

#subbabAiModal .btn-sync-sources {
    color: #34d399 !important;
    font-weight: 700 !important;
    background: rgba(16, 185, 129, 0.22) !important;
    border: 1.5px solid rgba(52, 211, 153, 0.5) !important;
    padding: 5px 12px !important;
    border-radius: 7px !important;
    font-size: 12px !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    transition: all 0.2s ease !important;
}

#subbabAiModal .btn-sync-sources:hover {
    background: rgba(16, 185, 129, 0.38) !important;
    box-shadow: 0 0 14px rgba(16, 185, 129, 0.45) !important;
    color: #ffffff !important;
}

#subbabAiModal .subbab-ai-references-list,
.subbab-ai-references-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
}

#subbabAiModal .subbab-reference-item,
.subbab-reference-item {
    background: rgba(8, 14, 28, 0.92) !important;
    border: 1.5px solid rgba(56, 189, 248, 0.22) !important;
    border-radius: 10px !important;
    padding: 12px 16px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    gap: 14px !important;
    transition: all 0.2s ease !important;
}

#subbabAiModal .subbab-reference-item:hover,
.subbab-reference-item:hover {
    border-color: rgba(56, 189, 248, 0.5) !important;
    background: rgba(15, 23, 42, 0.98) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
}

#subbabAiModal .subbab-reference-num,
.subbab-reference-num {
    font-size: 12.5px !important;
    font-weight: 800 !important;
    color: #38bdf8 !important;
    flex-shrink: 0 !important;
    margin-top: 1px !important;
}

#subbabAiModal .subbab-reference-citation,
.subbab-reference-citation {
    font-size: 13px !important;
    color: #ffffff !important;
    font-weight: 500 !important;
    line-height: 1.55 !important;
    word-break: break-word !important;
}

#subbabAiModal .btn-ref-action,
.btn-ref-action {
    background: rgba(30, 41, 59, 0.8) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 6px !important;
    padding: 5px 8px !important;
    color: #cbd5e1 !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.15s ease !important;
}

#subbabAiModal .btn-ref-action:hover,
.btn-ref-action:hover {
    background: rgba(56, 189, 248, 0.25) !important;
    color: #ffffff !important;
    border-color: #38bdf8 !important;
}

#subbabAiModal .btn-ref-add-source,
.btn-ref-add-source {
    background: rgba(16, 185, 129, 0.2) !important;
    color: #34d399 !important;
    border: 1px solid rgba(16, 185, 129, 0.5) !important;
    border-radius: 6px !important;
    font-size: 11.5px !important;
    font-weight: 700 !important;
    padding: 4px 10px !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    transition: all 0.15s ease !important;
    white-space: nowrap !important;
}

#subbabAiModal .btn-ref-add-source:hover,
.btn-ref-add-source:hover {
    background: rgba(16, 185, 129, 0.35) !important;
    color: #ffffff !important;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.4) !important;
}

/* Badges inside subbabAiModal */
#subbabAiModal .badge-biru {
    background: rgba(56, 189, 248, 0.2) !important;
    color: #38bdf8 !important;
    border: 1px solid rgba(56, 189, 248, 0.45) !important;
    font-weight: 700 !important;
}

#subbabAiModal .badge-hijau {
    background: rgba(16, 185, 129, 0.2) !important;
    color: #34d399 !important;
    border: 1px solid rgba(52, 211, 153, 0.5) !important;
    font-weight: 700 !important;
}

#subbabAiModal .badge-kuning {
    background: rgba(245, 158, 11, 0.2) !important;
    color: #fbbf24 !important;
    border: 1px solid rgba(245, 158, 11, 0.5) !important;
    font-weight: 700 !important;
}

#subbabAiModal .badge-abu {
    background: rgba(148, 163, 184, 0.2) !important;
    color: #f1f5f9 !important;
    border: 1px solid rgba(148, 163, 184, 0.35) !important;
    font-weight: 600 !important;
}

#subbabAiModal .badge-ungu {
    background: rgba(168, 85, 247, 0.2) !important;
    color: #d8b4fe !important;
    border: 1px solid rgba(168, 85, 247, 0.45) !important;
    font-weight: 700 !important;
}

/* Right Column: Academic Guidance Panels */
#subbabAiModal .subbab-ai-col-right,
#subbabAiModal .ai-modal-col-right {
    min-width: 0 !important;
    width: 100% !important;
    background: linear-gradient(160deg, rgba(15, 23, 42, 0.96) 0%, rgba(13, 22, 40, 0.94) 100%) !important;
    border: 1.5px solid rgba(56, 189, 248, 0.28) !important;
    border-radius: 16px !important;
    padding: 20px !important;
    box-sizing: border-box !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
}

#subbabAiModal .subbab-ai-panel-section {
    margin-bottom: 18px !important;
}

#subbabAiModal .subbab-ai-panel-heading {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    font-size: 13.5px !important;
    font-weight: 800 !important;
    color: #38bdf8 !important;
    margin-bottom: 10px !important;
    letter-spacing: 0.2px !important;
    text-shadow: 0 0 12px rgba(56, 189, 248, 0.4) !important;
}

#subbabAiModal .subbab-ai-purpose-text {
    font-size: 13px !important;
    color: #ffffff !important;
    line-height: 1.6 !important;
    margin: 0 !important;
    background: rgba(8, 14, 28, 0.92) !important;
    border: 1px solid rgba(56, 189, 248, 0.28) !important;
    border-left: 4px solid #38bdf8 !important;
    border-radius: 10px !important;
    padding: 12px 16px !important;
    font-weight: 500 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

#subbabAiModal .subbab-ai-guiding-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
}

#subbabAiModal .subbab-ai-guiding-list li {
    font-size: 12.5px !important;
    line-height: 1.55 !important;
    color: #f1f5f9 !important;
    background: rgba(8, 14, 28, 0.9) !important;
    border: 1px solid rgba(56, 189, 248, 0.2) !important;
    border-radius: 10px !important;
    padding: 10px 14px 10px 30px !important;
    position: relative !important;
    font-weight: 500 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25) !important;
    transition: all 0.2s ease !important;
}

#subbabAiModal .subbab-ai-guiding-list li:hover {
    border-color: rgba(56, 189, 248, 0.45) !important;
    background: rgba(15, 23, 42, 0.95) !important;
}

#subbabAiModal .subbab-ai-guiding-list li::before {
    content: '•' !important;
    position: absolute !important;
    left: 12px !important;
    top: 9px !important;
    color: #38bdf8 !important;
    font-size: 17px !important;
    line-height: 1 !important;
}

#subbabAiModal .subbab-ai-checklist-group {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
}

#subbabAiModal .subbab-checklist-item {
    display: flex !important;
    align-items: flex-start !important;
    gap: 10px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    line-height: 1.55 !important;
    color: #ffffff !important;
    background: rgba(8, 14, 28, 0.92) !important;
    border: 1.5px solid rgba(16, 185, 129, 0.38) !important;
    border-radius: 10px !important;
    padding: 11px 15px !important;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35) !important;
    transition: all 0.2s ease !important;
}

#subbabAiModal .subbab-checklist-item:hover {
    background: rgba(13, 24, 44, 0.98) !important;
    border-color: rgba(52, 211, 153, 0.65) !important;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.25) !important;
    transform: translateY(-1px) !important;
}

#subbabAiModal .checklist-check-icon {
    color: #34d399 !important;
    font-weight: 900 !important;
    font-size: 15px !important;
    line-height: 1.2 !important;
    flex-shrink: 0 !important;
    text-shadow: 0 0 10px #10b981, 0 0 20px rgba(16, 185, 129, 0.8) !important;
}

#subbabAiModal .subbab-ai-academic-note {
    background: rgba(30, 58, 138, 0.28) !important;
    border: 1.5px solid rgba(59, 130, 246, 0.35) !important;
    border-radius: 12px !important;
    padding: 14px 16px !important;
    margin-top: 18px !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25) !important;
}

#subbabAiModal .academic-note-title {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    color: #93c5fd !important;
    font-size: 12.5px !important;
    font-weight: 700 !important;
    margin-bottom: 6px !important;
}

#subbabAiModal .academic-note-desc {
    color: #cbd5e1 !important;
    font-size: 11.5px !important;
    line-height: 1.55 !important;
    margin: 0 !important;
}

#subbabAiModal .subbab-ai-flags-box {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.16) 0%, rgba(180, 83, 9, 0.12) 100%) !important;
    border: 1.5px solid rgba(245, 158, 11, 0.5) !important;
    border-radius: 12px !important;
    padding: 14px 18px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35) !important;
}

#subbabAiModal .subbab-ai-flags-box strong,
#subbabAiModal .flags-box-title {
    color: #fbbf24 !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    letter-spacing: 0.2px !important;
    text-shadow: 0 0 10px rgba(245, 158, 11, 0.5) !important;
}

#subbabAiModal .subbab-ai-flags-box ul,
#subbabAiModal .subbab-ai-flags-box li,
#subbabAiModal .flags-box-list,
#subbabAiModal .flags-box-list li {
    color: #ffffff !important;
    font-size: 12.5px !important;
    line-height: 1.6 !important;
    font-weight: 600 !important;
}

/* Modal Footer */
#subbabAiModal .modal-footer,
#subbabAiModal .subbab-ai-modal-footer {
    padding: 16px 28px !important;
    background: linear-gradient(180deg, #090e1a 0%, #060a12 100%) !important;
    border-top: 1px solid rgba(56, 189, 248, 0.22) !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 14px !important;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5) !important;
}

#subbabAiModal .subbab-footer-left {
    display: flex !important;
    align-items: center !important;
    gap: 16px !important;
}

#subbabAiModal .btn-subbab-footer-cancel {
    background: rgba(30, 41, 59, 0.8) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: #e2e8f0 !important;
    padding: 9px 18px !important;
    border-radius: 9px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

#subbabAiModal .btn-subbab-footer-cancel:hover {
    background: rgba(51, 65, 85, 0.95) !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
}

#subbabAiModal .subbab-footer-checkbox-label {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    font-size: 13px !important;
    color: #e2e8f0 !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    user-select: none !important;
    margin: 0 !important;
}

#subbabAiModal .subbab-footer-checkbox-label strong {
    color: #ffffff !important;
}

#subbabAiModal .subbab-custom-checkbox {
    accent-color: #8b5cf6 !important;
    width: 16px !important;
    height: 16px !important;
    cursor: pointer !important;
}

#subbabAiModal .subbab-footer-right {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
}

#subbabAiModal .btn-subbab-insert {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%) !important;
    border: 1px solid #34d399 !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    padding: 10px 20px !important;
    border-radius: 10px !important;
    font-size: 13px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 7px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4) !important;
}

#subbabAiModal .btn-subbab-insert:hover {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%) !important;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.6) !important;
    transform: translateY(-1px) !important;
    color: #ffffff !important;
}

#subbabAiModal .btn-subbab-replace {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #06b6d4 100%) !important;
    border: none !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    padding: 10px 22px !important;
    border-radius: 10px !important;
    font-size: 13px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 7px !important;
    cursor: pointer !important;
    transition: all 0.25s ease !important;
    box-shadow: 0 4px 18px rgba(124, 58, 237, 0.5) !important;
}

#subbabAiModal .btn-subbab-replace:hover {
    box-shadow: 0 6px 24px rgba(124, 58, 237, 0.7), 0 0 16px rgba(6, 182, 212, 0.6) !important;
    transform: translateY(-1px) !important;
    color: #ffffff !important;
}

/* Responsive Overrides */
#subbabAiModal .ai-modal-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.85fr) !important;
    gap: 24px !important;
}

@media (max-width: 1100px) {
    #subbabAiModal .modal-box-wide,
    #subbabAiModal .subbab-ai-modal-box {
        max-width: 96vw !important;
        width: 96vw !important;
    }
    #subbabAiModal .ai-modal-grid {
        grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.85fr) !important;
        gap: 18px !important;
    }
    .subbab-ai-modal-header,
    #subbabAiModal .modal-body,
    .subbab-ai-modal-footer {
        padding: 16px 20px !important;
    }
}

@media (max-width: 860px) {
    #subbabAiModal .modal-box-wide,
    #subbabAiModal .subbab-ai-modal-box {
        max-width: 98vw !important;
        width: 98vw !important;
        max-height: 95vh !important;
    }
    #subbabAiModal .modal-body {
        max-height: calc(95vh - 130px) !important;
        padding: 14px 16px !important;
    }
    .subbab-ai-modal-header,
    .subbab-ai-modal-footer {
        padding: 14px 16px !important;
    }
    #subbabAiModal .ai-modal-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
}

/* ==========================================================================
   E-Book Reader: Enhanced Deep Dive, Case Studies, Examples & Templates
   ========================================================================== */
.ebook-subtitle {
    font-size: 14px;
    font-weight: 500;
    color: #475569;
    line-height: 1.55;
    margin-top: -12px;
    margin-bottom: 24px;
}

.ebook-section-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 800;
    color: #0f172a;
    margin: 28px 0 14px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #f1f5f9;
}

.ebook-deep-dive {
    font-size: 14.5px;
    line-height: 1.85;
    color: #1e293b;
    margin-bottom: 24px;
}

.ebook-deep-dive p {
    margin-bottom: 14px;
}

.ebook-case-study {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1.5px solid #bae6fd;
    border-radius: 14px;
    padding: 18px 20px;
    margin-bottom: 26px;
    box-shadow: 0 4px 14px rgba(14, 165, 233, 0.08);
}

.ebook-case-study-badge {
    font-size: 11px;
    font-weight: 800;
    background: #0284c7;
    color: #ffffff;
    padding: 3px 10px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.ebook-case-study-title {
    font-size: 14.5px;
    font-weight: 800;
    color: #0369a1;
    margin: 0 0 6px 0;
}

.ebook-case-study-body {
    font-size: 13.5px;
    color: #0c4a6e;
    line-height: 1.65;
    margin: 0;
}

/* Comparison Grid: Bad vs Good Example */
.ebook-comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 28px;
}

@media (max-width: 900px) {
    .ebook-comparison-grid {
        grid-template-columns: 1fr;
    }
}

.ebook-example-card {
    border-radius: 14px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.ebook-example-card.bad {
    background: #fef2f2;
    border: 1.5px solid #fecaca;
}

.ebook-example-card.good {
    background: #f0fdf4;
    border: 1.5px solid #bbf7d0;
}

.ebook-example-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.ebook-example-badge {
    font-size: 10.5px;
    font-weight: 800;
    padding: 3px 9px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.ebook-example-badge.bad {
    background: #ef4444;
    color: #ffffff;
}

.ebook-example-badge.good {
    background: #10b981;
    color: #ffffff;
}

.ebook-example-title {
    font-size: 13.5px;
    font-weight: 700;
    margin: 0 0 8px 0;
}

.ebook-example-card.bad .ebook-example-title { color: #991b1b; }
.ebook-example-card.good .ebook-example-title { color: #166534; }

.ebook-example-quote {
    background: #ffffff;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 13px;
    line-height: 1.6;
    margin: 0 0 12px 0;
    font-style: italic;
    border-left: 4px solid;
    white-space: pre-line;
}

.ebook-example-card.bad .ebook-example-quote {
    border-left-color: #ef4444;
    color: #7f1d1d;
}

.ebook-example-card.good .ebook-example-quote {
    border-left-color: #10b981;
    color: #14532d;
    font-style: normal;
    font-weight: 500;
}

.ebook-example-footer {
    font-size: 12px;
    line-height: 1.55;
    padding-top: 8px;
    border-top: 1px dashed;
}

.ebook-example-card.bad .ebook-example-footer {
    border-top-color: #fca5a5;
    color: #991b1b;
}

.ebook-example-card.good .ebook-example-footer {
    border-top-color: #86efac;
    color: #166534;
}

/* Template Academic Sentence Box */
.ebook-template-card {
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 26px;
}

.ebook-template-item {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.ebook-template-text {
    font-size: 13px;
    color: #1e293b;
    line-height: 1.6;
    font-family: monospace, inherit;
    flex: 1;
}

.ebook-copy-btn {
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.ebook-copy-btn:hover {
    background: #2563eb;
    color: #ffffff;
}

/* Do's and Don'ts Grid */
.ebook-dos-donts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 28px;
}

@media (max-width: 768px) {
    .ebook-dos-donts-grid {
        grid-template-columns: 1fr;
    }
}

.ebook-checklist-box {
    border-radius: 12px;
    padding: 16px;
}

.ebook-checklist-box.dos {
    background: #f0fdf4;
    border: 1.5px solid #bbf7d0;
}

.ebook-checklist-box.donts {
    background: #fef2f2;
    border: 1.5px solid #fecaca;
}

.ebook-checklist-box h5 {
    font-size: 13px;
    font-weight: 800;
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ebook-checklist-box.dos h5 { color: #15803d; }
.ebook-checklist-box.donts h5 { color: #b91c1c; }

.ebook-checklist-box ul {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 12.5px;
    line-height: 1.6;
}

.ebook-checklist-box.dos li {
    padding-left: 20px;
    position: relative;
    color: #166534;
    margin-bottom: 6px;
}

.ebook-checklist-box.dos li::before {
    content: "✓";
    position: absolute;
    left: 0;
    font-weight: 800;
    color: #16a34a;
}

.ebook-checklist-box.donts li {
    padding-left: 20px;
    position: relative;
    color: #991b1b;
    margin-bottom: 6px;
}

.ebook-checklist-box.donts li::before {
    content: "✕";
    position: absolute;
    left: 0;
    font-weight: 800;
    color: #dc2626;
}

/* Action Execution Box */
.ebook-action-card {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    border-radius: 16px;
    padding: 22px 26px;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 32px;
    box-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.4);
    flex-wrap: wrap;
}

.ebook-action-content {
    flex: 1;
    min-width: 260px;
}

.ebook-action-badge {
    font-size: 11px;
    font-weight: 800;
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    padding: 3px 10px;
    border-radius: 20px;
    display: inline-block;
    margin-bottom: 8px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.ebook-action-title {
    font-size: 16px;
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 6px 0;
}

.ebook-action-desc {
    font-size: 13px;
    color: #bfdbfe;
    margin: 0;
    line-height: 1.5;
}

.ebook-action-btn-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.ebook-btn-execute {
    background: #ffffff;
    color: #1d4ed8;
    font-size: 13px;
    font-weight: 800;
    padding: 10px 20px;
    border-radius: 10px;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ebook-btn-execute:hover {
    background: #f8fafc;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.ebook-btn-copilot {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-size: 13px;
    font-weight: 700;
    padding: 10px 16px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ebook-btn-copilot:hover {
    background: rgba(255, 255, 255, 0.28);
}

/* ==========================================================================
   Full Chapter Preview Modal & Docx Paper Simulation
   ========================================================================== */

.btn-preview-chapter {
    font-size: 12px;
    padding: 6px 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-color: #cbd5e1;
    color: #1e293b;
    background: #ffffff;
    font-weight: 600;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-preview-chapter:hover {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.12);
}

.chapter-preview-modal-box {
    max-width: 980px !important;
    width: 94vw !important;
    max-height: 94vh !important;
    height: 94vh;
    display: flex;
    flex-direction: column;
    padding: 0 !important;
    overflow: hidden !important;
    background: #f8fafc;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
}

/* ==========================================================================
   CHAPTER FULL PREVIEW MODAL - ULTRA-LUXURY ACADEMIC MANUSCRIPT VIEWER
   ========================================================================== */
#chapterPreviewModal.modal-backdrop.active,
#chapterPreviewModal.active,
#chapterPreviewModal.modal-backdrop {
    background: rgba(2, 6, 23, 0.88) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    z-index: 99999 !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px !important;
    box-sizing: border-box !important;
}

#chapterPreviewModal .modal-box-wide,
#chapterPreviewModal .chapter-preview-modal-box {
    max-width: 1200px !important;
    width: 95vw !important;
    max-height: 94vh !important;
    background: linear-gradient(165deg, #090e1a 0%, #0d1628 50%, #080c16 100%) !important;
    border-radius: 22px !important;
    border: 1px solid rgba(56, 189, 248, 0.28) !important;
    box-shadow: 0 35px 100px -15px rgba(0, 0, 0, 0.95), 0 0 50px -10px rgba(56, 189, 248, 0.2) !important;
    color: #f8fafc !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    animation: chapterPreviewBoxEnter 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes chapterPreviewBoxEnter {
    from { opacity: 0; transform: scale(0.96) translateY(12px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

#chapterPreviewModal .chapter-preview-header,
#chapterPreviewModal .modal-header {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.98) 0%, rgba(20, 30, 50, 0.95) 100%) !important;
    border-bottom: 1px solid rgba(56, 189, 248, 0.22) !important;
    padding: 20px 28px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    flex-shrink: 0 !important;
    gap: 16px !important;
    position: relative !important;
}

#chapterPreviewModal .chapter-preview-header::after {
    content: '' !important;
    position: absolute !important;
    bottom: 0 !important;
    left: 28px !important;
    right: 28px !important;
    height: 1px !important;
    background: linear-gradient(90deg, transparent 0%, rgba(56, 189, 248, 0.45) 50%, transparent 100%) !important;
}

#chapterPreviewModal .chapter-preview-header-left {
    display: flex !important;
    flex-direction: column !important;
    gap: 5px !important;
    flex: 1 !important;
    min-width: 0 !important;
}

#chapterPreviewModal .preview-badge-group {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    margin-bottom: 4px !important;
    flex-wrap: wrap !important;
}

#chapterPreviewModal .preview-badge-group .badge-biru {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.18) 0%, rgba(99, 102, 241, 0.18) 100%) !important;
    border: 1px solid rgba(56, 189, 248, 0.4) !important;
    color: #38bdf8 !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    padding: 4px 12px !important;
    border-radius: 999px !important;
    letter-spacing: 0.3px !important;
    text-shadow: 0 0 8px rgba(56, 189, 248, 0.4) !important;
}

#chapterPreviewModal .preview-badge-group .badge-hijau {
    background: rgba(16, 185, 129, 0.2) !important;
    border: 1px solid rgba(52, 211, 153, 0.45) !important;
    color: #34d399 !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    padding: 4px 12px !important;
    border-radius: 999px !important;
    text-shadow: 0 0 8px rgba(52, 211, 153, 0.4) !important;
}

#chapterPreviewModal .preview-modal-title {
    font-size: 21px !important;
    font-weight: 900 !important;
    color: #ffffff !important;
    letter-spacing: -0.3px !important;
    margin: 2px 0 4px !important;
    text-shadow: 0 0 16px rgba(56, 189, 248, 0.35) !important;
}

#chapterPreviewModal .modal-subtext {
    color: #cbd5e1 !important;
    font-size: 12.5px !important;
    line-height: 1.5 !important;
    margin: 0 !important;
    font-weight: 500 !important;
}

#chapterPreviewModal .chapter-preview-header-actions {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    flex-shrink: 0 !important;
}

#chapterPreviewModal .preview-action-btn {
    font-size: 12px !important;
    padding: 8px 14px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    font-weight: 700 !important;
    border-radius: 9px !important;
    text-decoration: none !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

#chapterPreviewModal .preview-btn-word {
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%) !important;
    border: 1px solid #60a5fa !important;
    color: #ffffff !important;
    box-shadow: 0 3px 12px rgba(37, 99, 235, 0.4) !important;
}

#chapterPreviewModal .preview-btn-word:hover {
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%) !important;
    box-shadow: 0 5px 18px rgba(37, 99, 235, 0.6) !important;
    transform: translateY(-1px) !important;
}

#chapterPreviewModal .preview-btn-print {
    background: rgba(30, 41, 59, 0.85) !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    color: #f1f5f9 !important;
}

#chapterPreviewModal .preview-btn-print:hover {
    background: rgba(51, 65, 85, 0.95) !important;
    border-color: rgba(255, 255, 255, 0.35) !important;
    color: #ffffff !important;
    transform: translateY(-1px) !important;
}

#chapterPreviewModal .modal-close,
#chapterPreviewModal .preview-modal-close {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #f1f5f9 !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 15px !important;
    cursor: pointer !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
    flex-shrink: 0 !important;
}

#chapterPreviewModal .modal-close:hover,
#chapterPreviewModal .preview-modal-close:hover {
    background: rgba(239, 68, 68, 0.35) !important;
    border-color: rgba(239, 68, 68, 0.6) !important;
    color: #ffffff !important;
    transform: rotate(90deg) !important;
}

/* Sticky Executive Live KPI Bar */
#chapterPreviewModal .preview-stats-bar {
    background: rgba(11, 18, 34, 0.96) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
    border-bottom: 1px solid rgba(56, 189, 248, 0.18) !important;
    padding: 12px 28px !important;
    display: flex !important;
    align-items: center !important;
    gap: 14px !important;
    flex-shrink: 0 !important;
    overflow-x: auto !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4) !important;
}

#chapterPreviewModal .preview-stat-item {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    white-space: nowrap !important;
    background: rgba(15, 23, 42, 0.75) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    padding: 8px 16px !important;
    border-radius: 12px !important;
    transition: all 0.2s ease !important;
}

#chapterPreviewModal .preview-stat-item:hover {
    border-color: rgba(56, 189, 248, 0.35) !important;
    background: rgba(20, 30, 50, 0.9) !important;
    transform: translateY(-1px) !important;
}

#chapterPreviewModal .preview-stat-item.highlight-stat {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.25) 0%, rgba(56, 189, 248, 0.18) 100%) !important;
    border: 1.5px solid rgba(56, 189, 248, 0.5) !important;
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.2) !important;
}

#chapterPreviewModal .preview-stat-icon {
    font-size: 18px !important;
    line-height: 1 !important;
    filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.4)) !important;
}

#chapterPreviewModal .preview-stat-meta {
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
}

#chapterPreviewModal .preview-stat-label {
    font-size: 10px !important;
    color: #94a3b8 !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

#chapterPreviewModal .preview-stat-value {
    font-size: 14.5px !important;
    font-weight: 900 !important;
    color: #ffffff !important;
}

#chapterPreviewModal .preview-stat-value.highlight-value {
    color: #38bdf8 !important;
    text-shadow: 0 0 10px rgba(56, 189, 248, 0.5) !important;
}

#chapterPreviewModal .preview-stat-hint {
    font-size: 10px !important;
    color: #38bdf8 !important;
    background: rgba(56, 189, 248, 0.15) !important;
    border: 1px solid rgba(56, 189, 248, 0.4) !important;
    padding: 2px 7px !important;
    border-radius: 6px !important;
    font-weight: 700 !important;
    margin-left: 6px !important;
}

#chapterPreviewModal .preview-stat-divider {
    width: 1px !important;
    height: 28px !important;
    background: rgba(255, 255, 255, 0.1) !important;
    flex-shrink: 0 !important;
}

/* Paper Desk Mat Environment */
#chapterPreviewModal .chapter-preview-body,
#chapterPreviewModal .modal-body {
    flex: 1 !important;
    overflow-y: auto !important;
    background: radial-gradient(circle at 50% 15%, #0d1628 0%, #050811 100%) !important;
    background-image: radial-gradient(rgba(56, 189, 248, 0.07) 1px, transparent 1px), radial-gradient(circle at 50% 15%, #0d1628 0%, #050811 100%) !important;
    background-size: 24px 24px, 100% 100% !important;
    padding: 36px 20px 48px !important;
    position: relative !important;
}

#chapterPreviewModal .chapter-preview-body::-webkit-scrollbar {
    width: 8px !important;
}
#chapterPreviewModal .chapter-preview-body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.25) !important;
}
#chapterPreviewModal .chapter-preview-body::-webkit-scrollbar-thumb {
    background: rgba(56, 189, 248, 0.35) !important;
    border-radius: 4px !important;
}
#chapterPreviewModal .chapter-preview-body::-webkit-scrollbar-thumb:hover {
    background: rgba(56, 189, 248, 0.6) !important;
}

#chapterPreviewModal .preview-paper-wrapper {
    max-width: 840px !important;
    margin: 0 auto !important;
    position: relative !important;
}

/* Authentic A4 Bond Paper Sheet */
#chapterPreviewModal .preview-docx-sheet {
    background: #ffffff !important;
    border-radius: 4px !important;
    box-shadow: 0 25px 70px -10px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1), 0 8px 30px rgba(0, 0, 0, 0.45) !important;
    border: 1px solid #cbd5e1 !important;
    padding: 60px 56px 72px 64px !important;
    font-family: "Times New Roman", Times, Georgia, serif !important;
    font-size: 12pt !important;
    line-height: 1.5 !important;
    color: #111827 !important;
    text-align: justify !important;
    box-sizing: border-box !important;
    position: relative !important;
}

#chapterPreviewModal .preview-docx-sheet::before {
    content: 'STANDAR FORMAT SKRIPSI (A4 • TNR 12PT • 1.5 SPASI • MARGIN 4-4-3-3 CM)';
    position: absolute;
    top: 18px;
    left: 64px;
    right: 56px;
    display: flex;
    justify-content: space-between;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 8.5px;
    font-weight: 800;
    letter-spacing: 1px;
    color: #94a3b8;
    border-bottom: 1px dashed #e2e8f0;
    padding-bottom: 6px;
    pointer-events: none;
}

#chapterPreviewModal .docx-chapter-title-box {
    text-align: center !important;
    margin-top: 16px !important;
    margin-bottom: 34px !important;
    text-transform: uppercase !important;
}

#chapterPreviewModal .docx-main-chapter-num {
    font-size: 14pt !important;
    font-weight: bold !important;
    margin: 0 0 6pt 0 !important;
    letter-spacing: 0.5px !important;
    color: #000000 !important;
}

#chapterPreviewModal .docx-main-chapter-sub {
    font-size: 14pt !important;
    font-weight: bold !important;
    margin: 0 !important;
    letter-spacing: 0.5px !important;
    color: #000000 !important;
}

#chapterPreviewModal .docx-section-block {
    margin-bottom: 24pt !important;
}

#chapterPreviewModal .docx-section-heading {
    font-size: 12pt !important;
    font-weight: bold !important;
    margin: 20pt 0 10pt 0 !important;
    color: #000000 !important;
}

#chapterPreviewModal .preview-docx-sheet p {
    margin: 0 0 10pt 0 !important;
    line-height: 1.5 !important;
    text-indent: 1.25cm !important;
    text-align: justify !important;
    font-size: 12pt !important;
}

#chapterPreviewModal .docx-empty-notice {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    font-size: 12.5px !important;
    color: #92400e !important;
    background: #fffbeb !important;
    border: 1px dashed #f59e0b !important;
    border-radius: 8px !important;
    padding: 12px 16px !important;
    margin: 10px 0 18px 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    font-style: normal !important;
}

#chapterPreviewModal .docx-empty-link {
    font-size: 12px !important;
    color: #2563eb !important;
    font-weight: 700 !important;
    text-decoration: none !important;
}

#chapterPreviewModal .preview-page-divider {
    position: relative !important;
    border: none !important;
    border-top: 2px dashed #94a3b8 !important;
    margin: 40pt -56pt 34pt -64pt !important;
    text-align: center !important;
}

#chapterPreviewModal .preview-page-divider-pill {
    position: absolute !important;
    top: -12px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    background: #0f172a !important;
    color: #38bdf8 !important;
    border: 1px solid rgba(56, 189, 248, 0.4) !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    font-size: 10px !important;
    font-weight: 800 !important;
    padding: 3px 14px !important;
    border-radius: 9999px !important;
    letter-spacing: 0.5px !important;
    text-transform: uppercase !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

/* Executive Footer */
#chapterPreviewModal .chapter-preview-footer,
#chapterPreviewModal .modal-footer {
    background: linear-gradient(180deg, #090e1a 0%, #060a12 100%) !important;
    border-top: 1px solid rgba(56, 189, 248, 0.22) !important;
    padding: 16px 28px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-shrink: 0 !important;
    flex-wrap: wrap !important;
    gap: 14px !important;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5) !important;
}

#chapterPreviewModal .preview-footer-note {
    font-size: 12.5px !important;
    color: #cbd5e1 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    font-weight: 500 !important;
}

#chapterPreviewModal .preview-footer-note strong {
    color: #38bdf8 !important;
}

#chapterPreviewModal .btn-preview-cancel {
    background: rgba(30, 41, 59, 0.8) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: #e2e8f0 !important;
    padding: 9px 18px !important;
    border-radius: 9px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

#chapterPreviewModal .btn-preview-cancel:hover {
    background: rgba(51, 65, 85, 0.95) !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
}

#chapterPreviewModal .btn-preview-export {
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 50%, #0284c7 100%) !important;
    border: 1px solid #38bdf8 !important;
    color: #ffffff !important;
    font-weight: 800 !important;
    padding: 10px 22px !important;
    border-radius: 10px !important;
    font-size: 13px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    text-decoration: none !important;
    cursor: pointer !important;
    transition: all 0.25s ease !important;
    box-shadow: 0 4px 18px rgba(37, 99, 235, 0.45) !important;
}

#chapterPreviewModal .btn-preview-export:hover {
    box-shadow: 0 6px 24px rgba(37, 99, 235, 0.7), 0 0 16px rgba(56, 189, 248, 0.5) !important;
    transform: translateY(-1px) !important;
    color: #ffffff !important;
}

/* Print Stylesheet for Direct PDF / Print Output */
@media print {
    body * {
        visibility: hidden !important;
    }
    #chapterPreviewModal,
    #chapterPreviewModal *,
    #chapterPreviewPrintArea,
    #chapterPreviewPrintArea * {
        visibility: visible !important;
    }
    #chapterPreviewModal {
        position: static !important;
        background: transparent !important;
        padding: 0 !important;
        margin: 0 !important;
        display: block !important;
    }
    .chapter-preview-modal-box {
        position: static !important;
        box-shadow: none !important;
        border: none !important;
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        max-height: none !important;
        background: transparent !important;
    }
    .chapter-preview-header,
    .preview-stats-bar,
    .chapter-preview-footer,
    .docx-empty-notice,
    .modal-close,
    .preview-page-divider-pill {
        display: none !important;
    }
    .chapter-preview-body {
        padding: 0 !important;
        background: transparent !important;
        overflow: visible !important;
    }
    .preview-docx-sheet {
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    .preview-page-divider {
        page-break-after: always;
        break-after: page;
        border: none !important;
        margin: 0 !important;
        height: 0 !important;
    }
}

/* ==========================================================================
   CITATION SYNC & TRACKER STYLES (BANK SUMBER <-> CHAPTER BUILDERS)
   ========================================================================== */

/* Top Utility Pill Tracker */
.btn-citation-tracker {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    color: #334155;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: 8px;
    font-size: 11.5px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-citation-tracker:hover {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #1d4ed8;
    transform: translateY(-1px);
}

.citation-unread-badge {
    background: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
    padding: 2px 7px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    animation: pulseSoft 2.5s infinite;
}

@keyframes pulseSoft {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.85; transform: scale(1.03); }
}

/* Citation Sync Card (Above Textarea) */
.citation-sync-card {
    border-radius: 12px;
    margin-bottom: 14px;
    transition: all 0.3s ease;
    overflow: hidden;
}

.citation-sync-card.has-uncited {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 1px solid #fde68a;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.08);
}

.citation-sync-card.all-cited {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 1px solid #bbf7d0;
}

.citation-sync-header {
    padding: 12px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    gap: 12px;
}

.citation-sync-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.citation-sync-icon-box {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.has-uncited .citation-sync-icon-box {
    background: #fef08a;
}

.all-cited .citation-sync-icon-box {
    background: #86efac;
}

.citation-sync-title {
    margin: 0 0 2px 0;
    font-size: 13.5px;
    font-weight: 700;
}

.has-uncited .citation-sync-title {
    color: #92400e;
}

.all-cited .citation-sync-title {
    color: #166534;
}

.citation-count-highlight {
    background: #d97706;
    color: #ffffff;
    padding: 1px 7px;
    border-radius: 6px;
    font-weight: 800;
    font-size: 12px;
}

.citation-sync-subtitle {
    margin: 0;
    font-size: 11.5px;
    line-height: 1.35;
}

.has-uncited .citation-sync-subtitle {
    color: #b45309;
}

.all-cited .citation-sync-subtitle {
    color: #15803d;
}

.btn-toggle-citation-list {
    background: #ffffff;
    border: 1px solid #f59e0b;
    color: #b45309;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 11.5px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: all 0.2s;
}

.all-cited .btn-toggle-citation-list {
    border-color: #16a34a;
    color: #15803d;
}

.btn-toggle-citation-list:hover {
    background: #fefce8;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
}

.citation-chevron {
    font-size: 12px;
    transition: transform 0.25s ease;
    display: inline-block;
}

/* Collapsible drawer & items grid */
.citation-sync-body {
    padding: 4px 18px 16px 18px;
    border-top: 1px solid rgba(245, 158, 11, 0.2);
}

.citation-body-hint {
    font-size: 11.5px;
    color: #92400e;
    margin-bottom: 12px;
    background: rgba(255, 255, 255, 0.6);
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.citation-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.citation-chip-card {
    background: #ffffff;
    border: 1px solid #fed7aa;
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    transition: all 0.2s;
}

.citation-chip-card:hover {
    border-color: #fb923c;
    box-shadow: 0 4px 12px rgba(251, 146, 60, 0.15);
    transform: translateY(-2px);
}

.citation-chip-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
}

.citation-chip-cite {
    font-size: 11.5px;
    font-weight: 800;
    color: #4338ca;
    background: #e0e7ff;
    padding: 2px 7px;
    border-radius: 5px;
    letter-spacing: -0.01em;
}

.citation-chip-role {
    font-size: 10px;
    font-weight: 600;
}

.citation-chip-title {
    font-size: 12px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.citation-chip-meta {
    font-size: 11px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-insert-citation {
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    border: none;
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 100%;
    transition: all 0.2s;
}

.btn-insert-citation:hover {
    background: linear-gradient(135deg, #4338ca 0%, #4f46e5 100%);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
    transform: translateY(-1px);
}

.citation-card-inserted {
    background: #ecfdf5 !important;
    border-color: #6ee7b7 !important;
    transition: all 0.4s ease;
}

/* Copilot Card Enhanced Sources Filter & Actions */
.copilot-sources-filter-row {
    display: flex;
    gap: 4px;
    margin-bottom: 10px;
    background: #f1f5f9;
    padding: 3px;
    border-radius: 8px;
}

.copilot-src-filter-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: #64748b;
    font-size: 10.5px;
    font-weight: 600;
    padding: 4px 6px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
    white-space: nowrap;
}

.copilot-src-filter-btn.active {
    background: #ffffff;
    color: #1e293b;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    font-weight: 700;
}

.copilot-cite-code {
    font-size: 11px;
    font-weight: 700;
    color: #4338ca;
    background: #e0e7ff;
    padding: 1px 6px;
    border-radius: 4px;
}

.copilot-role-tag {
    color: #6366f1;
    font-weight: 600;
}

.btn-copilot-insert-cite {
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    color: #4338ca;
    font-size: 10.5px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 5px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s;
    width: 100%;
    justify-content: center;
}

.btn-copilot-insert-cite:hover {
    background: #4f46e5;
    border-color: #4f46e5;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.25);
}

.copilot-source-item.status-cited {
    border-left: 3px solid #10b981;
}

.copilot-source-item.status-uncited {
    border-left: 3px solid #f59e0b;
}

/* Floating Toast Notification */
.citation-floating-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #1e293b;
    color: #ffffff;
    padding: 12px 20px;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 600;
    z-index: 999999;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.citation-floating-toast.toast-active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.citation-floating-toast .toast-sparkle {
    font-size: 16px;
    color: #fbbf24;
}

/* ==========================================================================
   Fitur Uji Keselarasan Antar Bab & Subbab (AI Coherence Inspector)
   ========================================================================== */

/* Trigger Button in Header */
.btn-coherence-header {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: linear-gradient(135deg, #4338ca 0%, #3b82f6 100%);
    color: #ffffff !important;
    border: none;
    border-radius: 10px;
    padding: 8px 16px;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(67, 56, 202, 0.28);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
    text-decoration: none;
}

.btn-coherence-header:hover {
    transform: translateY(-1.5px);
    box-shadow: 0 4px 16px rgba(67, 56, 202, 0.42);
    background: linear-gradient(135deg, #3730a3 0%, #2563eb 100%);
}

.coherence-scale-icon {
    font-size: 14px;
    transition: transform 0.25s ease;
}

.btn-coherence-header:hover .coherence-scale-icon {
    transform: rotate(-10deg) scale(1.15);
}

.badge-coherence-tag {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 8px;
    letter-spacing: 0.5px;
}

/* Trigger Button in Subbab Toolbar */
.btn-subbab-coherence-tool {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    font-size: 11.5px;
    font-weight: 700;
    color: #4338ca;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    border-radius: 9999px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.btn-subbab-coherence-tool:hover {
    background: #e0e7ff;
    color: #3730a3;
    border-color: #a5b4fc;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(67, 56, 202, 0.15);
}

/* Modal Backdrop & Container */
#coherenceModal.modal-backdrop {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background-color: rgba(15, 23, 42, 0.78) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    display: none;
    align-items: center !important;
    justify-content: center !important;
    z-index: 99999 !important;
    padding: 20px !important;
    box-sizing: border-box !important;
}

/* ==========================================================================
   AI COHERENCE INSPECTOR (UJI KESELARASAN) - ULTRA-PREMIUM LUXURY DESIGN
   ========================================================================== */

#coherenceModal.modal-backdrop.active,
#coherenceModal.active {
    display: flex !important;
    background: rgba(2, 6, 23, 0.85) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
    z-index: 99999 !important;
}

#coherenceModal .coherence-modal-box {
    max-width: 1140px !important;
    width: 95vw !important;
    max-height: 93vh !important;
    background: linear-gradient(165deg, #090e1a 0%, #0d1628 50%, #080c16 100%) !important;
    border-radius: 22px !important;
    box-shadow: 0 35px 100px -15px rgba(0, 0, 0, 0.9), 0 0 50px -10px rgba(56, 189, 248, 0.2) !important;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(56, 189, 248, 0.28) !important;
    color: #f8fafc !important;
    animation: coherenceBoxEnter 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes coherenceBoxEnter {
    from { opacity: 0; transform: scale(0.96) translateY(12px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

#coherenceModal .coherence-modal-header,
#coherenceModal .modal-header,
.coherence-modal-header {
    padding: 22px 30px !important;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.98) 0%, rgba(20, 30, 50, 0.95) 100%) !important;
    border-bottom: 1px solid rgba(56, 189, 248, 0.22) !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    gap: 16px !important;
    position: relative !important;
}

#coherenceModal .coherence-modal-header::after {
    content: '' !important;
    position: absolute !important;
    bottom: 0 !important;
    left: 30px !important;
    right: 30px !important;
    height: 1px !important;
    background: linear-gradient(90deg, transparent 0%, rgba(56, 189, 248, 0.45) 50%, transparent 100%) !important;
}

#coherenceModal .coherence-modal-title-group {
    flex: 1 !important;
    min-width: 0 !important;
}

#coherenceModal .modal-header-badge-row {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    margin-bottom: 10px !important;
    flex-wrap: wrap !important;
}

#coherenceModal .coherence-pill-brand {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.22) 0%, rgba(99, 102, 241, 0.22) 100%) !important;
    border: 1px solid rgba(56, 189, 248, 0.45) !important;
    color: #38bdf8 !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    padding: 4px 12px !important;
    border-radius: 999px !important;
    letter-spacing: 0.3px !important;
    text-shadow: 0 0 10px rgba(56, 189, 248, 0.5) !important;
    box-shadow: 0 2px 10px rgba(56, 189, 248, 0.2) !important;
}

#coherenceModal .coherence-pill-engine {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    background: rgba(16, 185, 129, 0.2) !important;
    border: 1px solid rgba(52, 211, 153, 0.45) !important;
    color: #34d399 !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    padding: 4px 12px !important;
    border-radius: 999px !important;
    text-shadow: 0 0 8px rgba(52, 211, 153, 0.4) !important;
}

#coherenceModal .engine-pulse-dot {
    width: 6px !important;
    height: 6px !important;
    border-radius: 50% !important;
    background: #34d399 !important;
    box-shadow: 0 0 8px #34d399 !important;
    animation: pulseGlow 1.5s infinite !important;
}

#coherenceModal .coherence-pill-project {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    background: rgba(30, 41, 59, 0.85) !important;
    border: 1px solid rgba(56, 189, 248, 0.35) !important;
    color: #f1f5f9 !important;
    font-size: 11.5px !important;
    font-weight: 600 !important;
    padding: 4px 12px !important;
    border-radius: 999px !important;
    max-width: 420px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25) !important;
}

#coherenceModal .coherence-modal-title {
    font-size: 21px !important;
    font-weight: 900 !important;
    color: #ffffff !important;
    letter-spacing: -0.4px !important;
    margin: 0 0 6px !important;
    text-shadow: 0 0 16px rgba(56, 189, 248, 0.35) !important;
    display: block !important;
}

#coherenceModal .coherence-modal-subtext {
    font-size: 13px !important;
    color: #cbd5e1 !important;
    margin: 0 !important;
    line-height: 1.5 !important;
    font-weight: 500 !important;
}

#coherenceModal .coherence-modal-close {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #f1f5f9 !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 15px !important;
    cursor: pointer !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
    flex-shrink: 0 !important;
}

#coherenceModal .coherence-modal-close:hover {
    background: rgba(239, 68, 68, 0.35) !important;
    border-color: rgba(239, 68, 68, 0.6) !important;
    color: #ffffff !important;
    transform: rotate(90deg) !important;
}

.coherence-modal-body {
    padding: 24px 30px !important;
    overflow-y: auto !important;
    max-height: calc(93vh - 145px) !important;
    background: transparent !important;
}

.coherence-modal-body::-webkit-scrollbar {
    width: 7px;
}
.coherence-modal-body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}
.coherence-modal-body::-webkit-scrollbar-thumb {
    background: rgba(56, 189, 248, 0.3);
    border-radius: 4px;
}
.coherence-modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(56, 189, 248, 0.5);
}

#coherenceModal .coherence-modal-footer,
#coherenceModal .modal-footer,
.coherence-modal-footer {
    padding: 16px 30px !important;
    background: linear-gradient(180deg, #090e1a 0%, #060a12 100%) !important;
    border-top: 1px solid rgba(56, 189, 248, 0.22) !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 14px !important;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5) !important;
}

#coherenceModal .coherence-footer-tip {
    font-size: 12.5px !important;
    color: #cbd5e1 !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    line-height: 1.4 !important;
    font-weight: 500 !important;
}

.footer-tip-icon {
    font-size: 18px;
    filter: drop-shadow(0 0 6px rgba(250, 204, 21, 0.6));
}

.coherence-btn-close-footer {
    background: rgba(255, 255, 255, 0.07) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: #cbd5e1 !important;
    border-radius: 9px !important;
    padding: 7px 18px !important;
    font-weight: 700 !important;
    font-size: 12px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

.coherence-btn-close-footer:hover {
    background: rgba(255, 255, 255, 0.14) !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
}

/* ==========================================================================
   RADAR & HOLOGRAPHIC SCANNER LOADING STATE
   ========================================================================== */
.coherence-loading-state {
    padding: 36px 12px;
    display: flex;
    justify-content: center;
}

.coherence-loading-card {
    background: linear-gradient(150deg, rgba(15, 23, 42, 0.9) 0%, rgba(30, 41, 59, 0.65) 100%);
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: 22px;
    padding: 42px 48px;
    max-width: 680px;
    width: 100%;
    text-align: center;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), inset 0 0 30px rgba(56, 189, 248, 0.08);
    position: relative;
    overflow: hidden;
}

.coherence-loading-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 30%, rgba(56, 189, 248, 0.08) 0%, transparent 50%);
    pointer-events: none;
}

.coherence-scanner-visual {
    position: relative;
    width: 110px;
    height: 110px;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scanner-orbit-ring {
    position: absolute;
    border-radius: 50%;
}

.scanner-orbit-ring.ring-outer {
    width: 100%;
    height: 100%;
    border: 2px dashed rgba(56, 189, 248, 0.35);
    animation: spinRing 9s linear infinite;
}

.scanner-orbit-ring.ring-middle {
    width: 82%;
    height: 82%;
    border: 2px solid transparent;
    border-top-color: #6366f1;
    border-right-color: #38bdf8;
    animation: spinRingReverse 4s linear infinite;
}

.scanner-orbit-ring.ring-inner {
    width: 64%;
    height: 64%;
    border: 1.5px dashed rgba(52, 211, 153, 0.45);
    animation: spinRing 6s linear infinite;
}

.scanner-pulse-aura {
    position: absolute;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.45) 0%, rgba(99, 102, 241, 0) 70%);
    animation: auraPulse 2s ease-in-out infinite;
}

.scanner-center-orb {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95) 0%, rgba(15, 23, 42, 0.98) 100%);
    border: 1.5px solid rgba(56, 189, 248, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.55), inset 0 0 8px rgba(56, 189, 248, 0.3);
}

.scanner-icon {
    font-size: 22px;
    filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.8));
}

@keyframes spinRing {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes spinRingReverse {
    from { transform: rotate(360deg); }
    to { transform: rotate(0deg); }
}

@keyframes auraPulse {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.6); opacity: 0.15; }
}

@keyframes pulseGlow {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

.scanner-badge-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.scanner-live-badge {
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.8px;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.3);
    padding: 3px 10px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-shadow: 0 0 8px rgba(56, 189, 248, 0.4);
}

.live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #38bdf8;
    box-shadow: 0 0 8px #38bdf8;
    animation: pulseGlow 1.2s infinite;
}

.scanner-speed-badge {
    font-size: 10px;
    font-weight: 800;
    color: #34d399;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 3px 10px;
    border-radius: 999px;
}

.coherence-loading-title {
    font-size: 19px;
    font-weight: 900;
    color: #ffffff;
    letter-spacing: -0.3px;
    margin: 0 0 6px;
}

.coherence-loading-subtitle {
    font-size: 13px;
    color: #93c5fd;
    margin: 0 0 22px;
    font-weight: 500;
    min-height: 20px;
}

/* 5-Step Pipeline Chips in Scanner */
.scanner-steps-pipeline {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.scan-step-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #64748b;
    font-size: 11.5px;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.scan-step-chip.active {
    background: rgba(56, 189, 248, 0.18);
    border-color: rgba(56, 189, 248, 0.55);
    color: #38bdf8;
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.3);
    transform: translateY(-2px);
}

.scan-step-chip.completed {
    background: rgba(16, 185, 129, 0.16);
    border-color: rgba(16, 185, 129, 0.45);
    color: #34d399;
}

.step-chip-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

/* Laser Progress Row */
.scanner-progress-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.coherence-loading-progress-track {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.coherence-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1 0%, #38bdf8 50%, #34d399 100%);
    border-radius: 999px;
    position: relative;
    transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.progress-laser-head {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 12px;
    background: #ffffff;
    box-shadow: 0 0 12px 2px #38bdf8;
    border-radius: 50%;
}

.progress-percent-val {
    font-size: 13px;
    font-weight: 900;
    color: #38bdf8;
    font-variant-numeric: tabular-nums;
    width: 42px;
    text-align: right;
}

/* ==========================================================================
   OVERALL SCORE BANNER - EXECUTIVE DASHBOARD
   ========================================================================== */
.coherence-score-banner {
    display: flex;
    align-items: center;
    gap: 26px;
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.8) 0%, rgba(30, 41, 59, 0.5) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    padding: 24px 30px;
    margin-bottom: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(16px);
    position: relative;
    overflow: hidden;
}

.coherence-score-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 300px;
    height: 100%;
    background: radial-gradient(circle at 10% 50%, rgba(56, 189, 248, 0.12) 0%, transparent 65%);
    pointer-events: none;
}

.score-circle-outer {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(15, 23, 42, 0.95) 0%, rgba(2, 6, 23, 0.98) 100%);
    border: 3.5px solid #10b981;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 0 25px rgba(16, 185, 129, 0.35), inset 0 0 15px rgba(16, 185, 129, 0.2);
    position: relative;
}

.score-circle-outer.status-warning {
    border-color: #f59e0b;
    box-shadow: 0 0 25px rgba(245, 158, 11, 0.35), inset 0 0 15px rgba(245, 158, 11, 0.2);
}

.score-circle-outer.status-danger {
    border-color: #ef4444;
    box-shadow: 0 0 25px rgba(239, 68, 68, 0.35), inset 0 0 15px rgba(239, 68, 68, 0.2);
}

.score-number-wrap {
    display: flex;
    align-items: baseline;
    line-height: 1;
}

.score-val {
    font-size: 38px;
    font-weight: 900;
    color: #ffffff;
    letter-spacing: -1.5px;
    text-shadow: 0 0 16px rgba(255, 255, 255, 0.3);
}

.score-percent {
    font-size: 16px;
    font-weight: 800;
    color: #94a3b8;
    margin-left: 2px;
}

.score-label {
    font-size: 8px;
    font-weight: 900;
    color: #64748b;
    letter-spacing: 0.8px;
    margin-top: 3px;
    text-transform: uppercase;
}

.coherence-verdict-info {
    flex: 1;
    min-width: 0;
}

.verdict-heading-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.verdict-title {
    font-size: 20px;
    font-weight: 900;
    color: #ffffff;
    letter-spacing: -0.3px;
    margin: 0;
}

.verdict-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 12px;
    font-size: 11px;
    font-weight: 800;
    border-radius: 999px;
    letter-spacing: 0.3px;
}

.verdict-badge.badge-hijau {
    background: rgba(16, 185, 129, 0.18);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #34d399;
}

.verdict-badge.badge-kuning {
    background: rgba(245, 158, 11, 0.18);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #fbbf24;
}

.verdict-badge.badge-merah {
    background: rgba(239, 68, 68, 0.18);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #f87171;
}

.verdict-desc {
    font-size: 13.5px;
    color: #cbd5e1;
    line-height: 1.55;
    margin: 0 0 14px;
}

.coherence-meta-stats {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.coherence-meta-stats .stat-tag {
    font-size: 12px;
    color: #cbd5e1;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-weight: 600;
}

.coherence-meta-stats .stat-tag strong {
    color: #38bdf8;
    font-weight: 800;
}

.stat-tag.tag-verified {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
}

.btn-refresh-coherence {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.15) 0%, rgba(99, 102, 241, 0.15) 100%);
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: #38bdf8;
    font-size: 11.5px;
    font-weight: 800;
    padding: 5px 14px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-refresh-coherence:hover {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.25) 0%, rgba(99, 102, 241, 0.25) 100%);
    border-color: rgba(56, 189, 248, 0.6);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.25);
}

/* ==========================================================================
   5 PILLARS GRID - CYBER GLASS CARDS
   ========================================================================== */
.coherence-section-heading {
    font-size: 13.5px;
    font-weight: 900;
    color: #f8fafc;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.section-heading-icon {
    font-size: 16px;
    filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.4));
}

.coherence-pillars-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(195px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.pillar-card {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(12px);
    position: relative;
    overflow: hidden;
}

.pillar-card:hover {
    transform: translateY(-3px);
    border-color: rgba(56, 189, 248, 0.3);
    box-shadow: 0 12px 25px -5px rgba(0, 0, 0, 0.5), 0 0 20px rgba(56, 189, 248, 0.1);
}

.pillar-card.pillar-selaras {
    border-top: 3px solid #10b981;
    background: linear-gradient(160deg, rgba(16, 185, 129, 0.08) 0%, rgba(15, 23, 42, 0.75) 100%);
}

.pillar-card.pillar-peringatan {
    border-top: 3px solid #f59e0b;
    background: linear-gradient(160deg, rgba(245, 158, 11, 0.08) 0%, rgba(15, 23, 42, 0.75) 100%);
}

.pillar-card.pillar-kritis {
    border-top: 3px solid #ef4444;
    background: linear-gradient(160deg, rgba(239, 68, 68, 0.08) 0%, rgba(15, 23, 42, 0.75) 100%);
}

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

.pillar-title {
    font-size: 12.5px;
    font-weight: 800;
    color: #ffffff;
    margin: 0;
    line-height: 1.35;
}

.pillar-score-badge {
    font-size: 11px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 8px;
    white-space: nowrap;
}

.pillar-score-badge.badge-green {
    background: rgba(16, 185, 129, 0.18);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #34d399;
}
.pillar-score-badge.badge-yellow {
    background: rgba(245, 158, 11, 0.18);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #fbbf24;
}
.pillar-score-badge.badge-red {
    background: rgba(239, 68, 68, 0.18);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #f87171;
}

.pillar-finding {
    font-size: 11.5px;
    color: #cbd5e1;
    line-height: 1.5;
    margin: 0;
}

/* ==========================================================================
   INCOHERENT GAPS LIST - HIGH CONTRAST DARK CARDS
   ========================================================================== */
.coherence-gaps-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.gap-card {
    background: linear-gradient(150deg, rgba(15, 23, 42, 0.85) 0%, rgba(30, 41, 59, 0.6) 100%);
    border: 1px solid rgba(239, 68, 68, 0.35);
    border-left: 4.5px solid #ef4444;
    border-radius: 14px;
    padding: 18px 22px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.gap-card:hover {
    box-shadow: 0 14px 30px rgba(239, 68, 68, 0.18);
    border-color: rgba(239, 68, 68, 0.5);
    transform: translateY(-1px);
}

.gap-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.gap-target-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    font-weight: 800;
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.16);
    border: 1px solid rgba(239, 68, 68, 0.35);
    padding: 4px 12px;
    border-radius: 8px;
}

.gap-problem-quote {
    font-size: 13.5px;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 10px;
    line-height: 1.45;
}

.gap-detail-box {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 9px;
    padding: 10px 14px;
    margin-bottom: 10px;
    font-size: 12px;
    line-height: 1.5;
    color: #cbd5e1;
}

.gap-reason-tag {
    font-weight: 800;
    color: #f87171;
    margin-right: 5px;
}

.gap-recommendation-box {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.28);
    border-radius: 9px;
    padding: 10px 14px;
    font-size: 12px;
    line-height: 1.5;
    color: #a7f3d0;
    margin-bottom: 14px;
}

.gap-rec-tag {
    font-weight: 800;
    color: #34d399;
    margin-right: 5px;
}

.btn-trigger-align {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #6366f1 0%, #38bdf8 100%);
    color: #ffffff;
    border: none;
    border-radius: 9px;
    padding: 7px 16px;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 14px rgba(56, 189, 248, 0.35);
}

.btn-trigger-align:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(56, 189, 248, 0.5);
    background: linear-gradient(135deg, #4f46e5 0%, #0284c7 100%);
}

/* ==========================================================================
   AUTO-ALIGN DIFF BOX (AI HARMONIZER)
   ========================================================================== */
.coherence-autoalign-box {
    background: linear-gradient(150deg, #090e1a 0%, #0e172a 100%);
    border: 1.5px solid #38bdf8;
    border-radius: 18px;
    padding: 22px;
    margin-bottom: 24px;
    color: #f8fafc;
    box-shadow: 0 15px 40px rgba(56, 189, 248, 0.25);
    animation: fadeInSlideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInSlideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.autoalign-box-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.autoalign-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.autoalign-badge {
    background: linear-gradient(135deg, #6366f1 0%, #38bdf8 100%);
    color: #ffffff;
    font-size: 10.5px;
    font-weight: 900;
    padding: 3px 9px;
    border-radius: 6px;
    letter-spacing: 0.5px;
}

.autoalign-title {
    font-size: 15px;
    font-weight: 800;
    color: #ffffff;
    margin: 0;
}

.btn-close-align-box {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #cbd5e1;
    font-size: 11px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-close-align-box:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
}

.autoalign-changes-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.gain-badge {
    background: #10b981;
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    padding: 3px 9px;
    border-radius: 6px;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.align-changes-list {
    font-size: 12px;
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.autoalign-diff-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 16px;
}

@media (max-width: 768px) {
    .autoalign-diff-grid {
        grid-template-columns: 1fr;
    }
}

.diff-col {
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.diff-col-header {
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 9px 14px;
    font-size: 11.5px;
    font-weight: 700;
    color: #94a3b8;
}

.diff-col.col-after {
    border-color: rgba(34, 197, 94, 0.4);
    background: rgba(6, 78, 59, 0.12);
}

.diff-col.col-after .diff-col-header {
    background: rgba(34, 197, 94, 0.18);
    color: #86efac;
    border-color: rgba(34, 197, 94, 0.3);
}

.diff-col-body {
    padding: 14px 16px;
    font-size: 12px;
    line-height: 1.65;
    color: #cbd5e1;
    max-height: 230px;
    overflow-y: auto;
    white-space: pre-wrap;
    font-family: inherit;
}

.diff-col.col-after .diff-col-body {
    color: #f0fdf4;
    background: transparent;
}

.autoalign-box-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    align-items: center;
}

.btn-apply-align {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    border: none !important;
    box-shadow: 0 4px 18px rgba(16, 185, 129, 0.45) !important;
    font-weight: 900 !important;
    font-size: 12.5px !important;
    padding: 8px 20px !important;
    border-radius: 9px !important;
    color: #ffffff !important;
    cursor: pointer !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.btn-apply-align:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(16, 185, 129, 0.6) !important;
}






