/* Top Navigation */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-lg);
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.brand-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    position: relative;
    animation: brand-icon-pulse 3s ease-in-out infinite;
}

/* AI Thinking Glow Effect for Brand Icon */
@keyframes brand-icon-pulse {

    0%,
    100% {
        box-shadow:
            0 0 10px rgba(139, 92, 246, 0.4),
            0 0 20px rgba(102, 126, 234, 0.2);
    }

    33% {
        box-shadow:
            0 0 12px rgba(59, 130, 246, 0.5),
            0 0 25px rgba(59, 130, 246, 0.2);
    }

    66% {
        box-shadow:
            0 0 12px rgba(6, 182, 212, 0.5),
            0 0 25px rgba(6, 182, 212, 0.2);
    }
}

.brand-icon::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: calc(var(--radius-md) + 2px);
    background: linear-gradient(90deg,
            rgba(139, 92, 246, 0.7),
            rgba(59, 130, 246, 0.7),
            rgba(6, 182, 212, 0.7),
            rgba(139, 92, 246, 0.7));
    background-size: 300% 100%;
    animation: brand-icon-border-glow 3s ease-in-out infinite;
    z-index: -1;
    opacity: 0.5;
    filter: blur(4px);
}

@keyframes brand-icon-border-glow {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.brand-icon svg {
    width: 24px;
    height: 24px;
}

.brand-name {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.nav-links {
    display: flex;
    gap: var(--spacing-lg);
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.935rem;
    font-weight: 500;
    padding: 0.5rem 0;
    transition: color var(--transition-base);
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -1.5rem;
    /* Align with bottom of nav */
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent-primary);
    border-radius: 2px 2px 0 0;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding-left: var(--spacing-md);
    border-left: 1px solid var(--glass-border);
}

.avatar-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.user-profile {
    position: relative;
    cursor: pointer;
}

.profile-dropdown {
    display: none;
    position: absolute;
    top: 120%;
    right: 0;
    background: var(--bg-tertiary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 160px;
    padding: var(--spacing-xs);
    z-index: 1000;
    animation: fadeIn 0.2s ease-out;
}

.profile-dropdown.show {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    font-size: 0.935rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: all var(--transition-base);
    cursor: pointer;
}

.dropdown-item:hover {
    background: var(--bg-secondary);
    color: var(--status-closed);
}

.dropdown-item svg {
    width: 18px;
    height: 18px;
}


.username {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.btn-icon-sm {
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition-base);
}

.btn-icon-sm:hover {
    color: var(--status-closed);
}

/* Hero Section */
.hero-section {
    padding: var(--spacing-md) 0;
    text-align: center;
    animation: fadeIn 0.6s ease-out;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-family: var(--font-display);
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xl);
}

.hero-search-container {
    background: var(--frost-bg-dark);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 100px;
    padding: 6px;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 720px;
    margin: 0 auto var(--spacing-xl);
    box-shadow: var(--shadow-xl);
    transition: all 0.4s var(--morph-ease);
}

body.light-theme .hero-search-container {
    background: var(--frost-bg-light);
    /* Fix dark pill in light mode */
    border-color: rgba(203, 213, 225, 0.6);
    box-shadow: 0 10px 25px -5px rgba(99, 102, 241, 0.15);
}

.hero-search-container:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.2), var(--shadow-xl);
}

.search-input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    padding-left: var(--spacing-md);
    gap: var(--spacing-sm);
    color: var(--text-tertiary);
}

.hero-search-input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 1rem;
    width: 100%;
    font-family: var(--font-primary);
}

.hero-search-input::placeholder {
    color: var(--text-tertiary);
}

.hero-btn {
    border-radius: 100px !important;
    /* Force pill shape */
    padding: 10px 24px !important;
}

.hero-stats {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-lg);
}

.hero-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-val {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    font-feature-settings: "tnum";
}

.stat-lbl {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-tertiary);
    font-weight: 600;
}

/* Hero Workflow - Marketing Section */
.hero-workflow {
    margin-top: var(--spacing-lg);
    text-align: center;
}

.hero-workflow-title {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.hero-workflow-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.hero-workflow-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

.hero-workflow-step:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.step-number {
    width: 22px;
    height: 22px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
}

.step-text {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.step-connector {
    color: var(--text-tertiary);
    font-size: 1rem;
}

body.light-theme .hero-workflow-step {
    background: rgba(255, 255, 255, 0.6);
}

body.light-theme .step-number {
    color: #1a1a2e;
}

body.light-theme .step-text {
    color: var(--text-primary);
}


/* Dashboard Main */
.dashboard-main {
    animation: fadeInUp 500ms 0.2s both;
    padding-top: var(--spacing-lg);
}

.dashboard-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
}

.section-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    /* Slightly smaller than hero */
    font-weight: 600;
    color: var(--text-primary);
}

/* Getting Started Hints Section */
.getting-started-section {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
    animation: fadeInUp 0.5s ease-out;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

body.light-theme .getting-started-section {
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow:
        0 8px 32px rgba(99, 102, 241, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.getting-started-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.getting-started-header .section-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}

.btn-dismiss-hints {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-dismiss-hints:hover {
    background: rgba(248, 113, 113, 0.1);
    color: var(--status-closed);
    border-color: rgba(248, 113, 113, 0.3);
}

.hints-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.hint-card {
    position: relative;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-md);
    padding: var(--spacing-md) var(--spacing-md) var(--spacing-sm);
    text-align: center;
    transition: all 0.4s var(--morph-ease);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: float-gentle 6s ease-in-out infinite backwards;
}

.hint-card:nth-child(1) {
    animation-delay: 0s;
}

.hint-card:nth-child(2) {
    animation-delay: 0.5s;
}

.hint-card:nth-child(3) {
    animation-delay: 1s;
}

.hint-card:nth-child(4) {
    animation-delay: 1.5s;
}

body.light-theme .hint-card {
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow:
        0 4px 16px rgba(99, 102, 241, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.hint-card:hover {
    transform: translateY(-12px) scale(1.02);
    border-radius: 16px;
    border-color: rgba(129, 140, 248, 0.3);
    background: rgba(129, 140, 248, 0.05);
    box-shadow: 0 12px 32px rgba(99, 102, 241, 0.15);
}

body.light-theme .hint-card:hover {
    background: rgba(99, 102, 241, 0.05);
    border-color: rgba(99, 102, 241, 0.2);
}

.hint-step {
    position: absolute;
    top: -8px;
    left: -8px;
    width: 24px;
    height: 24px;
    background: var(--gradient-gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: white;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.hint-icon {
    width: 40px;
    height: 40px;
    margin: 0 auto var(--spacing-sm);
    color: var(--accent-primary);
    opacity: 0.8;
}

.hint-icon svg {
    width: 100%;
    height: 100%;
}

.hint-card h3 {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}

.hint-card p {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    line-height: 1.5;
    margin: 0;
}

.hint-card p strong {
    color: var(--text-secondary);
    font-weight: 500;
}

.hints-footer {
    padding-top: var(--spacing-sm);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

body.light-theme .hints-footer {
    border-top-color: rgba(203, 213, 225, 0.3);
}

.hints-tip {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    margin: 0;
    text-align: center;
}

.hints-tip strong {
    color: var(--text-secondary);
    font-weight: 500;
}

/* Getting Started Section Hidden State */
.getting-started-section.hidden {
    display: none;
}

/* Hero Add Case Button */
.hero-add-case-btn {
    margin-top: var(--spacing-lg);
    padding: 0.875rem 2rem;
    font-size: 1rem;
}

/* Responsive styles for hints */
@media (max-width: 1024px) {
    .hints-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .hints-grid {
        grid-template-columns: 1fr;
    }

    .getting-started-section {
        padding: var(--spacing-md);
    }

    .hint-card {
        padding: var(--spacing-sm);
    }

    .hint-icon {
        width: 32px;
        height: 32px;
    }
}

/* Buttons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: #000000;
    /* Black */
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-sm);
    /* Sharper corners */
    color: #ffffff;
    /* White text for contrast */
    font-size: 0.935rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

/* Button shimmer effect - AI buttons only */
#analyze-case-btn::before,
#generate-arguments-btn::before,
#analyze-case-stage-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    pointer-events: none;
    animation: btn-shimmer 6s ease-in-out infinite;
}

@keyframes btn-shimmer {

    0%,
    100% {
        left: -100%;
    }

    50% {
        left: 150%;
    }
}

.btn-primary:hover {
    background: #1a1a1a;
    transform: translateY(-3px) scale(1.02);
    box-shadow:
        var(--shadow-lg),
        0 15px 35px rgba(99, 102, 241, 0.2),
        0 0 40px rgba(139, 92, 246, 0.1);
    border-radius: calc(var(--radius-sm) + 2px);
}

.btn-primary:active {
    transform: translateY(0) scale(0.98);
    transition-duration: 0.1s;
}

.btn-primary svg {
    width: 18px;
    height: 18px;
    color: #ffffff;
}

/* AI Glow Effect for Analyze Case Button */
#analyze-case-btn {
    position: relative;
    overflow: hidden;
    z-index: 1;
    animation: analyze-btn-glow 3s ease-in-out infinite;
}

@keyframes analyze-btn-glow {

    0%,
    100% {
        box-shadow:
            0 0 15px rgba(139, 92, 246, 0.5),
            0 0 30px rgba(139, 92, 246, 0.3),
            0 0 45px rgba(139, 92, 246, 0.1),
            inset 0 0 15px rgba(139, 92, 246, 0.1);
    }

    33% {
        box-shadow:
            0 0 15px rgba(59, 130, 246, 0.5),
            0 0 30px rgba(59, 130, 246, 0.3),
            0 0 45px rgba(59, 130, 246, 0.1),
            inset 0 0 15px rgba(59, 130, 246, 0.1);
    }

    66% {
        box-shadow:
            0 0 15px rgba(6, 182, 212, 0.5),
            0 0 30px rgba(6, 182, 212, 0.3),
            0 0 45px rgba(6, 182, 212, 0.1),
            inset 0 0 15px rgba(6, 182, 212, 0.1);
    }
}

#analyze-case-btn:hover {
    animation: analyze-btn-glow-hover 2s ease-in-out infinite;
}

@keyframes analyze-btn-glow-hover {

    0%,
    100% {
        box-shadow:
            0 0 20px rgba(139, 92, 246, 0.7),
            0 0 40px rgba(139, 92, 246, 0.4),
            0 0 60px rgba(139, 92, 246, 0.2),
            inset 0 0 20px rgba(139, 92, 246, 0.15);
    }

    33% {
        box-shadow:
            0 0 20px rgba(59, 130, 246, 0.7),
            0 0 40px rgba(59, 130, 246, 0.4),
            0 0 60px rgba(59, 130, 246, 0.2),
            inset 0 0 20px rgba(59, 130, 246, 0.15);
    }

    66% {
        box-shadow:
            0 0 20px rgba(6, 182, 212, 0.7),
            0 0 40px rgba(6, 182, 212, 0.4),
            0 0 60px rgba(6, 182, 212, 0.2),
            inset 0 0 20px rgba(6, 182, 212, 0.15);
    }
}

#analyze-case-btn svg {
    animation: ai-icon-pulse 2s ease-in-out infinite;
}

/* Light theme adjustments for Analyze Case button AI glow */
body.light-theme #analyze-case-btn {
    animation: analyze-btn-glow-light 3s ease-in-out infinite;
}

@keyframes analyze-btn-glow-light {

    0%,
    100% {
        box-shadow:
            0 0 12px rgba(139, 92, 246, 0.4),
            0 0 24px rgba(139, 92, 246, 0.2),
            0 0 36px rgba(139, 92, 246, 0.1);
    }

    33% {
        box-shadow:
            0 0 12px rgba(59, 130, 246, 0.4),
            0 0 24px rgba(59, 130, 246, 0.2),
            0 0 36px rgba(59, 130, 246, 0.1);
    }

    66% {
        box-shadow:
            0 0 12px rgba(6, 182, 212, 0.4),
            0 0 24px rgba(6, 182, 212, 0.2),
            0 0 36px rgba(6, 182, 212, 0.1);
    }
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: #000000;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-sm);
    color: #ffffff;
    font-size: 0.935rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
}

/* Ensure SVG icons display correctly in buttons across browsers */
.btn-secondary svg,
.btn-primary svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    display: inline-block;
}

.btn-secondary:hover {
    border-color: rgba(255, 255, 255, 0.3);
    color: #ffffff;
    background: #1a1a1a;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-back:hover {
    color: var(--text-primary);
    transform: translateX(-4px);
}

.btn-back svg {
    width: 18px;
    height: 18px;
}

.btn-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    color: var(--text-secondary);
}

.btn-icon:hover {
    background: var(--bg-secondary);
    color: var(--status-closed);
    border-color: var(--status-closed);
}

.btn-icon svg {
    width: 20px;
    height: 20px;
}

.btn-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-base);
    color: var(--text-secondary);
}

.btn-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.btn-close svg {
    width: 18px;
    height: 18px;
}

/* Cases Grid */
.cases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--spacing-lg);
    padding-bottom: var(--spacing-xl);
}

.case-card {
    background: var(--frost-bg-dark);
    backdrop-filter: blur(var(--frost-blur)) saturate(var(--frost-saturation));
    -webkit-backdrop-filter: blur(var(--frost-blur)) saturate(var(--frost-saturation));
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: var(--spacing-md);
    cursor: pointer;
    transition: all 0.4s var(--morph-ease);
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: morph-in 0.5s var(--morph-ease) backwards;
    /* Performance optimizations */
    contain: layout style;
    will-change: transform, opacity;
}

/* Staggered animation for grid items */
.case-card:nth-child(1) {
    animation-delay: 0s;
}

.case-card:nth-child(2) {
    animation-delay: 0.1s;
}

.case-card:nth-child(3) {
    animation-delay: 0.15s;
}

.case-card:nth-child(4) {
    animation-delay: 0.2s;
}

.case-card:nth-child(5) {
    animation-delay: 0.25s;
}

.case-card:nth-child(6) {
    animation-delay: 0.3s;
}

.case-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    transition: background var(--transition-base);
}

/* Light theme overrides for case card */
/* Light theme overrides for case card */
body.light-theme .case-card {
    background: var(--frost-bg-light);
    border: 1px solid rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(var(--frost-blur)) saturate(var(--frost-saturation));
    -webkit-backdrop-filter: blur(var(--frost-blur)) saturate(var(--frost-saturation));
    box-shadow:
        0 4px 20px rgba(99, 102, 241, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

body.light-theme .case-card::before {
    background: rgba(99, 102, 241, 0.1);
}

.case-card:hover {
    transform: translateY(-8px) scale(1.01);
    border-radius: 24px;
    border-color: rgba(99, 102, 241, 0.3);
    background: rgba(129, 140, 248, 0.08);
    /* Slightly more opaque on hover */
    box-shadow:
        0 25px 50px rgba(99, 102, 241, 0.12),
        0 0 80px rgba(139, 92, 246, 0.08);
}

body.light-theme .case-card:hover {
    background: rgba(255, 255, 255, 0.75);
    border-color: rgba(99, 102, 241, 0.25);
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.12);
}

.case-card:hover::before {
    background: var(--accent-primary);
}

/* Light theme overrides */
body.light-theme .panel-tab.active {
    background: white;
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-md);
}

body.light-theme .panel-tab.active .tab-icon {
    filter: none;
    color: var(--accent-primary);
}

.case-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-md);
}

.case-card h3 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.case-status {
    padding: 0.375rem 0.875rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.case-status.active {
    background: rgba(67, 233, 123, 0.15);
    color: var(--status-active);
}

.case-status.pending {
    background: rgba(254, 202, 87, 0.15);
    color: var(--status-pending);
}

.case-status.closed {
    background: rgba(255, 107, 107, 0.15);
    color: var(--status-closed);
}

.case-status.review {
    background: rgba(79, 172, 254, 0.15);
    color: var(--status-review);
}

.case-card-footer {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.case-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-tertiary);
    font-size: 0.875rem;
}

.case-meta svg {
    width: 16px;
    height: 16px;
    opacity: 0.6;
}

/* Empty State */
.empty-state {
    display: none;
    text-align: center;
    padding: var(--spacing-xl) 0;
    animation: fadeIn var(--transition-base);
}

.empty-state.show {
    display: block;
}

.empty-icon {
    width: 120px;
    height: 120px;
    margin: 0 auto var(--spacing-lg);
    background: var(--glass-bg);
    border: 2px solid var(--glass-border);
    border-radius: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-icon svg {
    width: 60px;
    height: 60px;
    color: var(--text-tertiary);
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
}

.empty-state p {
    color: var(--text-tertiary);
    max-width: 500px;
    margin: 0 auto;
}

/* Case Detail */
.case-header {
    position: relative;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.5) 0%, rgba(248, 250, 252, 0.4) 50%, rgba(255, 255, 255, 0.5) 100%);
    backdrop-filter: blur(32px) saturate(200%);
    -webkit-backdrop-filter: blur(32px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-top: 1px solid rgba(255, 255, 255, 0.8);
    border-left: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    box-shadow:
        0 8px 32px rgba(99, 102, 241, 0.08),
        inset 0 1px 2px rgba(255, 255, 255, 0.9),
        inset 0 -1px 1px rgba(255, 255, 255, 0.3);
    animation: slideDown 500ms;
    flex-wrap: wrap;
    overflow: hidden;
}

/* Glass shimmer effect removed - now only on AI buttons */

/* Workflow Hint - Usage Guide (Subtle) */
.workflow-hint {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0;
    margin-top: 0.5rem;
    font-size: 0.7rem;
    color: var(--text-tertiary);
    opacity: 0.7;
    flex-wrap: wrap;
    width: 100%;
}

.workflow-label {
    font-weight: 500;
    color: var(--text-tertiary);
    margin-right: 0.25rem;
}

.workflow-step {
    color: var(--text-tertiary);
    font-weight: 400;
    white-space: nowrap;
}

.workflow-arrow {
    color: var(--text-tertiary);
    font-size: 0.75rem;
    opacity: 0.6;
}

body.light-theme .workflow-hint {
    opacity: 0.6;
}

.case-title-section {
    flex: 1;
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.case-title-section h1 {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

/* Hide mobile text labels on desktop */
.header-actions .btn-text-mobile {
    display: none;
}

/* Panel Navigation */
/* Case Workspace Layout - Sidebar + Content */
.case-workspace-layout {
    display: flex;
    gap: 0;
    align-items: stretch;
    min-height: calc(100vh - 200px);
    margin-left: calc(-1 * var(--spacing-lg));
    padding-right: var(--spacing-lg);
}

.panel-nav {
    position: sticky;
    top: 80px;
    z-index: 40;
    flex-shrink: 0;
    width: 180px;
    background: linear-gradient(165deg, rgba(15, 23, 42, 0.65) 0%, rgba(30, 41, 59, 0.8) 50%, rgba(15, 23, 42, 0.85) 100%);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(32px) saturate(180%);
    border: none;
    border-right: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 0;
    padding: 1rem 0.5rem;
    box-shadow:
        inset 1px 0 1px rgba(255, 255, 255, 0.05),
        inset 0 1px 1px rgba(255, 255, 255, 0.08),
        6px 0 32px -8px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 500ms 0.1s both;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    align-self: flex-start;
}

/* Sidebar glass highlight */
.panel-nav::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.08) 0%, transparent 100%);
    pointer-events: none;
    border-radius: 0;
}

body.light-theme .panel-nav {
    background: linear-gradient(165deg, rgba(15, 23, 42, 0.9) 0%, rgba(30, 41, 59, 0.85) 50%, rgba(15, 23, 42, 0.9) 100%);
    border-right-color: rgba(99, 102, 241, 0.2);
    box-shadow:
        inset 1px 0 1px rgba(255, 255, 255, 0.06),
        inset 0 1px 2px rgba(255, 255, 255, 0.1),
        6px 0 40px -8px rgba(0, 0, 0, 0.25);
}

.panel-nav-scroll {
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow-y: auto;
    scrollbar-width: none;
}

.panel-nav-scroll .panel-tab {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.panel-nav-scroll .panel-tab:last-child {
    border-bottom: none;
}

body.light-theme .panel-nav-scroll .panel-tab {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.panel-nav-scroll::-webkit-scrollbar {
    display: none;
}

/* Mobile dropdown elements - hidden on desktop */
.panel-dropdown,
.panel-dropdown-container,
.panel-dropdown-trigger,
.panel-dropdown-menu {
    display: none;
}

.panel-tab {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 0.625rem;
    padding: 0.625rem 0.75rem;
    padding-left: 0.875rem;
    background: transparent;
    border: none;
    border-left: 3px solid transparent;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    cursor: pointer;
    transition: all 0.3s var(--morph-ease);
    color: rgba(203, 213, 225, 0.9);
    font-weight: 500;
    font-size: 0.8125rem;
    width: 100%;
    position: relative;
    text-align: left;
    margin-left: -0.5rem;
    overflow: hidden;
    z-index: 1;
}

.panel-tab::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.05) 100%);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s var(--morph-ease);
    z-index: -1;
    border-radius: inherit;
}

.panel-tab:hover::before {
    transform: scaleX(1);
}

.panel-tab:hover {
    color: #e2e8f0;
    padding-left: 1rem;
}

.panel-tab.active {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.25) 0%, rgba(139, 92, 246, 0.15) 100%);
    border-left-color: #818cf8;
    color: #ffffff;
    border-radius: 0 16px 16px 0;
}

.panel-tab.active::after {
    content: '';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    background: #818cf8;
    border-radius: 50%;
    animation: pulse-dot 2s ease-in-out infinite;
    box-shadow: 0 0 8px #818cf8;
}

@keyframes pulse-dot {

    0%,
    100% {
        transform: translateY(-50%) scale(1);
        opacity: 1;
    }

    50% {
        transform: translateY(-50%) scale(1.5);
        opacity: 0.6;
    }
}

body.light-theme .panel-tab {
    color: rgba(203, 213, 225, 0.9);
}

body.light-theme .panel-tab:hover {
    background: rgba(99, 102, 241, 0.15);
    color: #f1f5f9;
}

body.light-theme .panel-tab.active {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.3) 0%, rgba(139, 92, 246, 0.18) 100%);
    border-left-color: #818cf8;
    color: #ffffff;
}

.tab-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.tab-icon svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    transition: all var(--transition-base);
}

.tab-label {
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Panel Update Indicator - shows when AI has updated a panel */
.panel-tab.has-update::after {
    content: '';
    position: absolute;
    top: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    background: linear-gradient(135deg, #10b981, #34d399);
    border-radius: 50%;
    border: 2px solid white;
    animation: update-indicator-pulse 2s ease-in-out infinite;
    z-index: 10;
}

@keyframes update-indicator-pulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
    }

    50% {
        transform: scale(1.1);
        box-shadow: 0 0 8px 2px rgba(16, 185, 129, 0.4);
    }
}

/* Update indicator for mobile dropdown */
.dropdown-option.has-update::after {
    content: '✨';
    margin-left: auto;
    font-size: 0.875rem;
    animation: update-indicator-pulse 2s ease-in-out infinite;
}

/* Light theme adjustments */
body.light-theme .panel-tab.has-update::after {
    border-color: white;
}

/* AI Tab Styles - Predictions (AI) - Cyan/Purple */
.panel-tab.panel-tab-ai {
    background: linear-gradient(90deg, rgba(6, 182, 212, 0.2) 0%, rgba(139, 92, 246, 0.12) 100%);
    border-left-color: transparent;
    color: #22d3ee;
    animation: ai-tab-glow 3s ease-in-out infinite;
}

@keyframes ai-tab-glow {

    0%,
    100% {
        box-shadow: inset 0 0 0 rgba(6, 182, 212, 0);
    }

    50% {
        box-shadow: inset 0 0 20px rgba(6, 182, 212, 0.15);
    }
}

.panel-tab.panel-tab-ai:hover {
    background: linear-gradient(90deg, rgba(6, 182, 212, 0.28) 0%, rgba(139, 92, 246, 0.18) 100%);
    color: #67e8f9;
}

.panel-tab.panel-tab-ai.active {
    background: linear-gradient(90deg, rgba(6, 182, 212, 0.35) 0%, rgba(139, 92, 246, 0.22) 100%);
    border-left-color: #22d3ee;
    color: #ffffff;
}

.panel-tab.panel-tab-ai .tab-icon svg {
    stroke: #22d3ee;
}


/* Light theme adjustments for AI tabs */
body.light-theme .panel-tab.panel-tab-ai {
    background: linear-gradient(90deg, rgba(6, 182, 212, 0.2) 0%, rgba(139, 92, 246, 0.12) 100%);
    color: #22d3ee;
}

body.light-theme .panel-tab.panel-tab-ai.active {
    background: linear-gradient(90deg, rgba(6, 182, 212, 0.35) 0%, rgba(139, 92, 246, 0.22) 100%);
}

/* Panels */
.panels-container {
    flex: 1;
    min-width: 0;
    position: relative;
    min-height: 500px;
    width: calc(100% - 180px);
}

.panel {
    display: none;
    background: var(--bg-tertiary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-lg);
    animation: fadeIn var(--transition-base);
    position: relative;
    overflow: hidden;
}

/* Removed excessive glass reflection overlay */
.panel::before {
    display: none;
}

.panel.active {
    display: block;
}

/* Panels inside workspace layout need to fill flex container */
.case-workspace-layout>.panel {
    flex: 1;
    min-width: 0;
}

/* Allow AI thinking effect to overflow */
.panel.ai-thinking {
    overflow: visible !important;
    isolation: isolate;
}

.panel-header {
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--glass-border);
}

.panel-header h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.panel-description {
    color: var(--text-tertiary);
    font-size: 0.9375rem;
}

.panel-content {
    min-height: 400px;
    /* Performance: isolate repaints to this container */
    contain: layout paint;
}

.panel-textarea {
    width: 100%;
    min-height: 400px;
    padding: var(--spacing-md);
    background: var(--bg-secondary);
    /* Darker input background */
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 1rem;
    line-height: 1.8;
    resize: vertical;
    transition: all var(--transition-base);
}

.panel-textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.1);
}

.panel-textarea::placeholder {
    color: var(--text-tertiary);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: all 0.3s ease;
}

/* Clean Glass Overlay with Thinking Effect */
#agent-thinking-modal .modal-overlay,
#upload-document-modal .modal-overlay {
    background-color: rgba(239, 241, 246, 0.809);
    backdrop-filter: blur(0.01px);
    -webkit-backdrop-filter: blur(0.011px);
    overflow: hidden;
}

#upload-document-modal.active {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Subtle Thinking Animation - Breathing Gradient */
#agent-thinking-modal .modal-overlay::before,
#upload-document-modal .modal-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.01;
    background: radial-gradient(circle at 50% 50%,
            rgba(129, 140, 248, 0.15),
            rgba(99, 102, 241, 0.05) 50%,
            transparent 80%);
    animation: thinking-breath 4s ease-in-out infinite;
    z-index: -1;
}

.modal-content {
    position: relative;
    z-index: 1;
    background: var(--bg-tertiary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    max-width: 500px;
    width: 90%;
    box-shadow: var(--shadow-xl);
    animation: modal-morph-in 0.4s var(--morph-bounce);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
}

.modal-header h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Forms */
.form-group {
    margin-bottom: var(--spacing-md);
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 600;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.875rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 1rem;
    transition: all var(--transition-base);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Custom select dropdown arrow - consistent across browsers */
.form-group select {
    padding-right: 2.5rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 12px;
    cursor: pointer;
}

body.light-theme .form-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    background-color: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group select:focus {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23818cf8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

.modal-actions {
    display: flex;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-lg);
}

.modal-actions button {
    flex: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: var(--spacing-sm);
    }

    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-md);
    }

    .header-stats {
        width: 100%;
        justify-content: space-around;
    }

    .cases-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-md);
    }

    .case-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .panel-nav-scroll {
        flex-direction: column;
    }

    .panel-tab {
        flex-direction: row;
        justify-content: flex-start;
        width: 100%;
    }
}

/* Arguments Panel Styles */
.arguments-actions {
    text-align: center;
    padding: var(--spacing-xl) 0;
}

.btn-generate {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: #000000;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    color: white;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.btn-generate:hover {
    background: #1a1a1a;
    transform: translateY(-2px) scale(1.02);
    box-shadow: var(--shadow-lg);
}

.btn-generate:active {
    transform: translateY(0) scale(0.98);
}

.btn-generate svg {
    width: 24px;
    height: 24px;
}

.arguments-hint {
    margin-top: var(--spacing-sm);
    color: var(--text-tertiary);
    font-size: 0.875rem;
}

/* ===================================
   Professional Argument Form Card
   =================================== */
.arg-form-card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.05));
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    max-width: 680px;
    margin: 0 auto;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.arg-form-header {
    padding: 1rem 1.5rem;
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.08), rgba(139, 92, 246, 0.04));
    border-bottom: 1px solid var(--glass-border);
}

.arg-form-title {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
}

.arg-form-title svg {
    color: #6366f1;
    flex-shrink: 0;
}

.arg-form-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.arg-form-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.arg-form-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.01em;
}

.arg-form-label svg {
    color: #94a3b8;
    flex-shrink: 0;
}

.arg-form-optional {
    font-weight: 400;
    color: var(--text-tertiary);
    font-size: 0.75rem;
}

.arg-form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    padding-right: 2.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 14px;
}

.arg-form-select:hover {
    border-color: #94a3b8;
}

.arg-form-select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236366f1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

.arg-form-textarea {
    width: 100%;
    min-height: 80px;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 0.9375rem;
    line-height: 1.6;
    resize: vertical;
    transition: all 0.2s ease;
}

.arg-form-textarea:hover {
    border-color: #94a3b8;
}

.arg-form-textarea:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.arg-form-textarea::placeholder {
    color: var(--text-tertiary);
    font-size: 0.875rem;
}

/* Two-column grid row for Court Type + High Court */
.arg-form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.arg-form-row .arg-form-field:nth-child(2) {
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (min-width: 540px) {
    .arg-form-row {
        grid-template-columns: 1fr 1fr;
    }
}

/* Form Footer */
.arg-form-footer {
    padding: 1.25rem 1.5rem;
    background: rgba(0, 0, 0, 0.02);
    border-top: 1px solid var(--glass-border);
    text-align: center;
}

.arg-form-footer .btn-generate {
    width: 100%;
    max-width: 280px;
    justify-content: center;
}

.arg-form-hint {
    margin-top: 0.75rem;
    color: var(--text-tertiary);
    font-size: 0.8125rem;
}

/* Light theme specific adjustments */
body.light-theme .arg-form-card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(248, 250, 252, 0.95));
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.03);
}

body.light-theme .arg-form-header {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.06), rgba(139, 92, 246, 0.03));
}

body.light-theme .arg-form-select,
body.light-theme .arg-form-textarea {
    background: rgba(255, 255, 255, 0.8);
}

body.light-theme .arg-form-footer {
    background: rgba(248, 250, 252, 0.8);
}


/* Loading State */
.arguments-loading {
    text-align: center;
    padding: var(--spacing-xl);
}

.spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto var(--spacing-md);
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ===================================
   PDF Upload Modal Styles
   =================================== */
.upload-area {
    margin: var(--spacing-md) 0;
    cursor: pointer;
}

.upload-placeholder {
    text-align: center;
    padding: var(--spacing-xl);
    background: rgba(255, 255, 255, 0.03);
    border: 2px dashed var(--glass-border);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

.upload-placeholder:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent-primary);
}

.upload-placeholder svg {
    width: 48px;
    height: 48px;
    margin: 0 auto var(--spacing-sm);
    color: var(--accent-primary);
}

.upload-placeholder h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.upload-placeholder p {
    color: var(--text-tertiary);
    font-size: 0.9375rem;
}

.upload-hint {
    font-size: 0.8125rem !important;
    margin-top: 0.5rem;
}

.upload-progress {
    text-align: center;
    padding: var(--spacing-xl);
}

.upload-progress p {
    margin-top: var(--spacing-md);
    color: var(--text-secondary);
}

/* Upload Progress Bar */
.upload-progress-bar-container {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    margin-top: var(--spacing-md);
    overflow: hidden;
    position: relative;
}

.upload-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #43e97b, #38f9d7, #667eea, #764ba2);
    background-size: 300% 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
    animation: progressGradient 2s ease infinite;
}

@keyframes progressGradient {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.upload-progress-percent {
    display: block;
    margin-top: var(--spacing-sm);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--accent-primary);
    font-variant-numeric: tabular-nums;
}

.selected-file {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    margin: var(--spacing-md) 0;
}

.selected-file svg {
    width: 32px;
    height: 32px;
    color: var(--accent-primary);
    flex-shrink: 0;
}

.selected-file span {
    flex: 1;
    font-weight: 500;
    color: var(--text-primary);
}

.selected-file .btn-icon {
    width: 32px;
    height: 32px;
}

.selected-file .btn-icon:hover {
    background: rgba(255, 107, 107, 0.1);
    border-color: #ff6b6b;
}

/* ===================================
   Markdown Rendering in Arguments
   =================================== */
#arguments-for,
#arguments-against {
    line-height: 1.8;
}

#arguments-for h1,
#arguments-against h1,
#arguments-for h2,
#arguments-against h2,
#arguments-for h3,
#arguments-against h3,
#arguments-for h4,
#arguments-against h4 {
    color: var(--text-primary);
    font-family: var(--font-display);
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

#arguments-for h1,
#arguments-against h1 {
    font-size: 1.5rem;
}

#arguments-for h2,
#arguments-against h2 {
    font-size: 1.25rem;
}

#arguments-for h3,
#arguments-against h3 {
    font-size: 1.125rem;
}

#arguments-for p,
#arguments-against p {
    margin-bottom: 1rem;
}

#arguments-for ul,
#arguments-against ul,
#arguments-for ol,
#arguments-against ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

#arguments-for li,
#arguments-against li {
    margin-bottom: 0.5rem;
}

#arguments-for strong,
#arguments-against strong {
    color: var(--accent-primary);
    font-weight: 600;
}

#arguments-for em,
#arguments-against em {
    font-style: italic;
    color: var(--text-secondary);
}

#arguments-for code,
#arguments-against code {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.875em;
}

#arguments-for pre,
#arguments-against pre {
    background: rgba(0, 0, 0, 0.3);
    padding: var(--spacing-md);
    border-radius: var(--radius-sm);
    overflow-x: auto;
    margin-bottom: 1rem;
}

#arguments-for pre code,
#arguments-against pre code {
    background: none;
    padding: 0;
}

#arguments-for blockquote,
#arguments-against blockquote {
    border-left: 3px solid var(--accent-primary);
    padding-left: var(--spacing-md);
    margin-left: 0;
    margin-bottom: 1rem;
    color: var(--text-secondary);
    font-style: italic;
}

#arguments-for hr,
#arguments-against hr {
    border: none;
    border-top: 1px solid var(--glass-border);
    margin: 1.5rem 0;
}

.spinner-small {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
}

.arguments-loading p {
    color: var(--text-secondary);
}

/* AI Thinking Glowing Border Effect */
@keyframes flameBreath {

    0%,
    100% {
        background-position: 0% 50%;
        opacity: 0.6;
        filter: blur(10px);
        transform: scale(1);
    }

    50% {
        background-position: 100% 50%;
        opacity: 1;
        filter: blur(18px);
        /* Flare up */
        transform: scale(1.02);
        /* Slight expansion */
    }
}

.ai-thinking {
    position: relative !important;
    border-color: transparent !important;
    border-radius: var(--radius-lg);
    z-index: 1;
    overflow: visible !important;
}

.ai-thinking::before {
    content: '';
    position: absolute;
    inset: -3px;
    background: linear-gradient(45deg, #ff00cc, #3333ff, #00ccff, #ff00cc);
    background-size: 400% 400%;
    z-index: -1;
    border-radius: inherit;
    animation: rainbow-border 3s ease infinite;
    filter: blur(15px);
    opacity: 0.6;
}

.ai-thinking::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: var(--bg-secondary);
    z-index: -1;
}



@keyframes gradientShift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

@keyframes aiGlow {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
    }

    50% {
        box-shadow: 0 0 40px rgba(102, 126, 234, 0.6), 0 0 60px rgba(79, 172, 254, 0.4);
    }
}

/* Error State */
.arguments-error {
    text-align: center;
    padding: var(--spacing-xl);
    background: rgba(255, 107, 107, 0.05);
    border: 1px solid rgba(255, 107, 107, 0.2);
    border-radius: var(--radius-md);
}

.arguments-error svg {
    width: 48px;
    height: 48px;
    margin: 0 auto var(--spacing-md);
    color: #ff6b6b;
}

.arguments-error p {
    color: #ff6b6b;
    font-weight: 500;
}

/* Arguments History Selector */
.arguments-history-selector {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
}

.arguments-history-selector label {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.arguments-version-dropdown {
    flex: 1;
    max-width: 400px;
    padding: 0.5rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-base);
}

.arguments-version-dropdown:hover {
    border-color: var(--accent-primary);
}

.arguments-version-dropdown:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.arguments-version-dropdown option {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 0.5rem;
}

/* Arguments Display */
.arguments-display {
    animation: fadeIn var(--transition-base);
}

.arguments-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
    max-width: 100%;
    overflow: hidden;
}

.argument-column {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    transition: all var(--transition-base);
    min-width: 0;
    overflow: hidden;
}

.argument-column:hover {
    background: rgba(255, 255, 255, 0.04);
}

.argument-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* Push items apart */
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid;
}

.btn-icon-export {
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon-export:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

.btn-icon-export svg {
    width: 20px;
    height: 20px;
}

.argument-for .argument-header {
    border-color: var(--status-active);
}

.argument-against .argument-header {
    border-color: var(--status-closed);
}

.argument-header svg {
    width: 24px;
    height: 24px;
}

.argument-for .argument-header svg {
    color: var(--status-active);
}

.argument-against .argument-header svg {
    color: var(--status-closed);
}

.argument-header h3 {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 600;
}

.argument-for .argument-header h3 {
    color: var(--status-active);
}

.argument-against .argument-header h3 {
    color: var(--status-closed);
}

.argument-content {
    color: var(--text-secondary);
    line-height: 1.8;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

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

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Streaming cursor animation */
.streaming-cursor {
    display: inline-block;
    animation: blink 1s step-end infinite;
    color: var(--accent-primary);
    font-weight: bold;
    margin-left: 2px;
}

@keyframes blink {

    0%,
    50% {
        opacity: 1;
    }

    51%,
    100% {
        opacity: 0;
    }
}

.streaming-placeholder {
    color: var(--text-tertiary);
    font-style: italic;
    opacity: 0.7;
}

/* =================================== */
/* Mobile Responsive Design            */
/* =================================== */
/* =====================================================
   MOBILE UX - 2025 Industry Standards
   ===================================================== */
@media (max-width: 768px) {

    /* ===== GLOBAL MOBILE SETTINGS ===== */
    :root {
        --mobile-padding: 16px;
        --mobile-header-height: 48px;
        --mobile-touch-target: 44px;
    }

    /* Container & Layout */
    .container {
        padding: 0;
        padding-bottom: 80px;
    }

    .view {
        padding: 0;
    }

    /* ================================================
       GLOBAL TOP NAV - MINIMAL MOBILE
       ================================================ */

    .global-top-nav {
        padding: 8px 16px;
        height: 64px;
        background: var(--bg-primary);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    }

    /* Simplify brand on mobile */
    .nav-brand .brand-name {
        font-size: 1rem;
    }

    /* Hide practice area tabs text on mobile, show only icons */
    .practice-area-tabs {
        background: transparent;
        padding: 0;
        gap: 4px;
    }

    .practice-tab {
        padding: 8px 12px;
        border-radius: 8px;
    }

    .practice-tab span:not(.coming-soon-badge) {
        display: none;
    }

    .coming-soon-badge {
        display: none;
    }

    /* Simplify user profile section */
    .nav-actions .username {
        display: none;
    }

    #case-detail-view .top-nav {
        display: none;
    }

    /* ===== DASHBOARD VIEW ===== */

    /* Hero Section - Simplified */
    .hero-section {
        padding: var(--spacing-lg) var(--mobile-padding);
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-search-container {
        max-width: 100%;
    }

    .header-content {
        padding: var(--mobile-padding);
    }

    .header-stats {
        justify-content: space-around;
    }

    .stat-item {
        min-width: 80px;
    }

    /* Dashboard Controls */
    .dashboard-controls {
        flex-direction: column;
        gap: var(--spacing-sm);
        padding: 0 var(--mobile-padding);
    }

    .dashboard-controls .btn-primary {
        width: 100%;
        justify-content: center;
        min-height: var(--mobile-touch-target);
    }

    /* Cases Grid */
    .cases-grid {
        padding: 0 var(--mobile-padding);
        grid-template-columns: 1fr;
    }

    /* ===== CASE DETAIL VIEW ===== */

    /* ================================================
       MINIMALIST MOBILE HEADER
       Ultra-clean: Back + Title + One Action Only
       ================================================ */

    .case-header {
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;
        width: 100%;
        z-index: 1000;

        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 8px;

        height: 48px;
        padding: 0 16px;
        margin: 0;
        box-sizing: border-box;

        /* Clean solid background */
        background: var(--bg-primary);
        border: none;
        border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    }

    /* Back Button - Simple Icon */
    .btn-back {
        padding: 0;
        margin: 0;
        width: 32px;
        height: 32px;
        min-width: 32px;
        min-height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        background: transparent;
        border: none;
        border-radius: 6px;
        color: var(--text-primary);
    }

    .btn-back:active {
        opacity: 0.6;
    }

    .btn-back span {
        display: none;
    }

    .btn-back svg {
        width: 20px;
        height: 20px;
    }

    /* Title Section - Just the name, clean */
    .case-title-section {
        flex: 1;
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 6px;
        overflow: hidden;
        min-width: 0;
    }

    .case-title-section h1 {
        font-size: 1rem;
        font-weight: 600;
        line-height: 1.2;
        margin: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        color: var(--text-primary);
    }

    /* Hide the status badge on mobile for cleaner look */
    .case-status {
        display: none;
    }

    /* ================================================
       HEADER ACTIONS - ICONS WITH SMALL LABELS
       Show Upload, Files, Analyse with text below icon
       ================================================ */

    .header-actions {
        display: flex;
        gap: 8px;
        flex-shrink: 0;
        align-items: flex-end;
    }

    /* Only hide Delete button on mobile */
    .header-actions #delete-case-btn {
        display: none !important;
    }

    /* Button layout: icon on top, text below */
    .header-actions .btn-secondary,
    .header-actions .btn-primary,
    .header-actions .btn-icon {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        padding: 4px 8px;
        min-width: 44px;
        height: auto;
        border-radius: 8px;
        background: transparent;
        border: none;
        color: var(--text-secondary);
    }

    .header-actions .btn-secondary:active,
    .header-actions .btn-primary:active,
    .header-actions .btn-icon:active {
        background: rgba(0, 0, 0, 0.05);
    }

    /* Hide desktop text, show mobile text */
    .header-actions .btn-text-desktop {
        display: none !important;
    }

    .header-actions .btn-text-mobile {
        display: block;
        font-size: 0.625rem;
        font-weight: 500;
        color: var(--text-tertiary);
        white-space: nowrap;
    }

    .header-actions .btn-secondary svg,
    .header-actions .btn-primary svg,
    .header-actions .btn-icon svg {
        width: 20px;
        height: 20px;
        color: var(--text-secondary);
        stroke: var(--text-secondary);
    }

    /* Workflow hint hidden */
    .workflow-hint {
        display: none !important;
    }

    /* ================================================
       PANEL NAVIGATION - MINIMAL DROPDOWN
       ================================================ */

    .case-workspace-layout {
        flex-direction: column;
        gap: 0;
        margin-left: 0;
        padding-right: 0;
    }

    .panel-nav {
        position: fixed;
        top: 112px;
        /* global-nav (64px) + case-header (48px) */
        left: 0;
        right: 0;
        width: 100%;
        z-index: 999;
        box-sizing: border-box;

        margin: 0;
        padding: 8px 16px;
        max-height: none;
        overflow: visible;

        background: var(--bg-primary);
        border: none;
        border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    }

    .panel-nav-scroll {
        display: none !important;
    }

    .panel-dropdown-container {
        display: block !important;
        position: relative;
        width: 100%;
        z-index: 1001;
    }

    /* Dropdown Trigger - Simple and Clean */
    .panel-dropdown-trigger {
        display: flex !important;
        align-items: center;
        gap: 8px;
        width: 100%;
        padding: 10px 12px;

        background: var(--bg-secondary);
        color: var(--text-primary);

        border: none;
        border-radius: 8px;

        font-size: 0.875rem;
        font-weight: 500;
        font-family: var(--font-primary);
        text-align: left;

        cursor: pointer;
    }

    .panel-dropdown-trigger:active {
        opacity: 0.8;
    }

    .panel-dropdown-container.open .panel-dropdown-trigger {
        background: var(--bg-tertiary);
    }

    .dropdown-icon {
        font-size: 1rem;
        flex-shrink: 0;
    }

    .dropdown-text {
        flex: 1;
    }

    .dropdown-arrow {
        width: 20px;
        height: 20px;
        opacity: 0.5;
        transition: transform 0.2s ease;
    }

    .panel-dropdown-container.open .dropdown-arrow {
        transform: rotate(180deg);
    }

    /* Dropdown Menu */
    .panel-dropdown-menu {
        display: none;
        position: absolute;
        top: calc(100% + 8px);
        left: 0;
        right: 0;
        z-index: 1000;

        background: var(--bg-tertiary);
        border: 1px solid var(--glass-border);
        border-radius: 12px;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);

        overflow: hidden;
        max-height: 60vh;
        overflow-y: auto;
    }

    .panel-dropdown-container.open .panel-dropdown-menu {
        display: block;
        animation: slideDown 0.2s ease;
    }

    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-8px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    /* Dropdown Options */
    .dropdown-option {
        display: flex;
        align-items: center;
        gap: 10px;
        width: 100%;
        padding: 14px 16px;

        background: transparent;
        color: var(--text-primary);
        border: none;
        border-bottom: 1px solid var(--glass-border);

        font-size: 1rem;
        font-family: var(--font-primary);
        text-align: left;

        cursor: pointer;
        transition: background 0.15s ease;
    }

    .dropdown-option:last-child {
        border-bottom: none;
    }

    .dropdown-option:active {
        background: rgba(251, 191, 36, 0.1);
    }

    .dropdown-option.active {
        background: var(--accent-primary);
        color: #0f172a;
        font-weight: 600;
    }

    /* AI Glow Effect for Arguments Dropdown Option (Mobile) */
    .dropdown-option[data-panel="arguments"] {
        position: relative;
        overflow: visible;
    }

    .dropdown-option[data-panel="arguments"]::before {
        content: '';
        position: absolute;
        inset: 0;
        background: linear-gradient(90deg,
                rgba(139, 92, 246, 0.15),
                rgba(59, 130, 246, 0.15),
                rgba(6, 182, 212, 0.15),
                rgba(139, 92, 246, 0.15));
        background-size: 300% 100%;
        animation: ai-glow-flow 3s ease-in-out infinite;
        z-index: -1;
    }

    /* Hide old native dropdown */
    .panel-dropdown {
        display: none !important;
    }

    /* Tab Pills - Hide on mobile */
    .panel-tab {
        display: none !important;
    }

    .tab-icon,
    .tab-label {
        display: none !important;
    }

    /* ===== PANELS CONTAINER ===== */

    .panels-container {
        position: relative;
        z-index: 1;
        margin: 0;
        padding: 0;
        /* global-nav (64px) + case-header (48px) + dropdown (~52px) */
        padding-top: 164px;
    }

    .panel {
        padding: var(--spacing-lg) var(--mobile-padding);
        margin: 0;
        border-radius: 0;
        border: none;
        background: var(--bg-primary);
        box-shadow: none;
    }

    .panel-header {
        margin-bottom: var(--spacing-md);
        padding-bottom: var(--spacing-sm);
        border-bottom: 1px solid var(--glass-border);
    }

    .panel-header h2 {
        font-size: 1.25rem;
    }

    .panel-description {
        font-size: 0.875rem;
        line-height: 1.5;
    }

    .panel-content {
        min-height: 300px;
    }

    /* Text Areas - Touch Optimized */
    .panel-textarea {
        min-height: 60vh;
        padding: 16px;
        font-size: 16px;
        /* Prevents zoom on iOS */
        line-height: 1.6;
        border-radius: 12px;
    }

    /* Markdown Preview */
    .panel-markdown-preview {
        min-height: 200px;
        padding: 16px;
        font-size: 1rem;
        line-height: 1.7;
        border-radius: 12px;
    }

    /* Arguments Display */
    .arguments-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }

    .argument-column {
        padding: var(--spacing-lg);
        border-radius: 12px;
    }

    /* ===== MODALS - FULL SCREEN ===== */

    .modal-content {
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        margin: 0;
        padding: var(--spacing-lg);
    }

    .modal-header {
        padding-bottom: var(--spacing-md);
        margin-bottom: var(--spacing-lg);
    }

    /* ===== TYPOGRAPHY ===== */

    body {
        font-size: 16px;
    }

    .section-title {
        font-size: 1.25rem;
    }

    /* ===== TOUCH IMPROVEMENTS ===== */

    /* Ensure all buttons meet minimum touch target */
    .btn-primary,
    .btn-secondary,
    .btn-icon {
        min-height: 44px;
        min-width: 44px;
    }

    /* Add active states for touch feedback */
    .btn-primary:active,
    .btn-secondary:active,
    .case-card:active {
        transform: scale(0.98);
        opacity: 0.9;
    }
}

/* =================================== */
/* Fluid Animations (2025 Design)      */
/* =================================== */

@keyframes shimmer-flow {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes soft-pulse {
    0% {
        transform: scale(1);
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(79, 172, 254, 0.4);
    }

    70% {
        transform: scale(1.02);
        opacity: 0.9;
        box-shadow: 0 0 0 10px rgba(79, 172, 254, 0);
    }

    100% {
        transform: scale(1);
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(79, 172, 254, 0);
    }
}

@keyframes gradient-border-rotate {
    0% {
        --angle: 0deg;
    }

    100% {
        --angle: 360deg;
    }
}

.btn-fluid-loading {
    position: relative;
    pointer-events: none;
    overflow: hidden;
    background-size: 200% 200% !important;
    animation: shimmer-flow 2s ease infinite;
    color: transparent !important;
    transition: all 0.3s ease;
}

.btn-fluid-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin-top: -10px;
    margin-left: -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    z-index: 2;
}

.btn-fluid-loading span,
.btn-fluid-loading svg {
    opacity: 0;
}

/* Status Pill for Upload */
.status-pill-container {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-left: 10px;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.status-pill-container.visible {
    opacity: 1;
    transform: translateX(0);
}

.status-pill {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--status-active);
    box-shadow: 0 0 10px var(--status-active);
    animation: pulse 1.5s infinite;
}

/* Analyze Button Thinking Effect */
.btn-thinking {
    animation: soft-pulse 2s infinite;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-size: 200% 200%;
}

/* Generate Arguments Button Thinking Effect */
.btn-generate-thinking {
    position: relative;
    background: linear-gradient(45deg, #43e97b, #38f9d7, #4facfe, #00f2fe);
    background-size: 300% 300%;
    animation: shimmer-flow 3s ease infinite;
    -webkit-text-fill-color: white;
    /* Ensure text remains visible if needed, but we usually hide it */
}

/* ========================================
   AGENT THINKING MODAL
   ======================================== */

/* Thinking Modal - Enhanced Glassy Effect */
/* Dark overlay - No blur */


/* Thinking Modal - Professional Light Glass Design */
.modal.thinking-modal .modal-content {
    max-width: 520px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.8) inset,
        0 8px 32px rgba(102, 126, 234, 0.1);
    position: relative;
    overflow: hidden;
    animation: modal-slide-up 0.3s ease-out;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
}

@keyframes modal-slide-up {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.thinking-modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
}

.thinking-modal-header h2 {
    font-family: var(--font-primary);
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e293b;
    background: none;
    -webkit-text-fill-color: #1e293b;
    text-shadow: none;
    letter-spacing: -0.01em;
}

.thinking-modal-header {
    background: rgba(248, 250, 252, 0.5);
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

.thinking-animation {
    display: flex;
    gap: 6px;
    align-items: center;
}

/* Professional Pulsing Dots Animation */
.thinking-animation .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    box-shadow: 0 0 8px rgba(102, 126, 234, 0.5);
    animation: professional-pulse 1.4s ease-in-out infinite;
    position: relative;
}

.thinking-animation .dot::after {
    display: none;
}

.thinking-animation .dot:nth-child(1) {
    animation-delay: 0s;
}

.thinking-animation .dot:nth-child(2) {
    animation-delay: 0.15s;
}

.thinking-animation .dot:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes professional-pulse {

    0%,
    80%,
    100% {
        transform: scale(0.6);
        opacity: 0.4;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes thinking-dots {

    0%,
    60%,
    100% {
        transform: scale(1);
        opacity: 0.7;
    }

    30% {
        transform: scale(1.4);
        opacity: 1;
    }
}

/* ===================================
   AI Progress Bar
   =================================== */
.ai-progress-container {
    width: 100%;
    margin-top: 1rem;
    position: relative;
    height: 6px;
    background: rgba(226, 232, 240, 0.6);
    border-radius: 3px;
    overflow: visible;
}

.ai-progress-bar {
    height: 100%;
    width: 0%;
    border-radius: 4px;
    position: relative;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(90deg,
            #667eea 0%,
            #764ba2 25%,
            #f093fb 50%,
            #5ee7df 75%,
            #667eea 100%);
    background-size: 200% 100%;
    animation: ai-progress-flow 2s linear infinite;
    box-shadow:
        0 0 12px rgba(102, 126, 234, 0.6),
        0 0 24px rgba(118, 75, 162, 0.4),
        0 0 36px rgba(94, 231, 223, 0.3);
}

.ai-progress-glow {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.9) 0%, rgba(240, 147, 251, 0.6) 50%, transparent 70%);
    animation: ai-glow-pulse 1s ease-in-out infinite;
    pointer-events: none;
}

.ai-progress-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
}

.ai-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #fff;
    border-radius: 50%;
    animation: ai-particle-float 1.5s ease-out forwards;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.8), 0 0 12px rgba(102, 126, 234, 0.6);
}

@keyframes ai-progress-flow {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 200% 50%;
    }
}

@keyframes ai-glow-pulse {

    0%,
    100% {
        transform: translateY(-50%) scale(1);
        opacity: 1;
    }

    50% {
        transform: translateY(-50%) scale(1.3);
        opacity: 0.7;
    }
}

@keyframes ai-particle-float {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    100% {
        opacity: 0;
        transform: translateY(-20px) scale(0);
    }
}

.thinking-modal-body {
    padding: var(--spacing-md);
    max-height: 350px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

/* Custom Scrollbar for Thinking Modal */
.thinking-modal-body::-webkit-scrollbar {
    width: 8px;
}

.thinking-modal-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.thinking-modal-body::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.5);
    border-radius: 4px;
}

.thinking-modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.7);
}

/* Thought Items - Professional Light Glass Theme */
.thought-item {
    padding: 0.75rem 1rem;
    background: rgba(248, 250, 252, 0.7);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 8px;
    color: #334155;
    animation: thought-slide-in 0.3s ease-out;
    transition: all 0.2s ease;
}

.thought-item:hover {
    background: rgba(241, 245, 249, 0.9);
    border-color: rgba(203, 213, 225, 0.8);
}

.thought-item.success {
    background: rgba(220, 252, 231, 0.7);
    border-color: rgba(134, 239, 172, 0.5);
}

.thought-item.success .thought-message {
    color: #166534;
}

.thought-item.error {
    background: rgba(254, 226, 226, 0.7);
    border-color: rgba(252, 165, 165, 0.5);
}

.thought-item.error .thought-message {
    color: #991b1b;
}

@keyframes thought-slide-in {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.thought-message {
    font-size: 0.875rem;
    color: #334155;
    line-height: 1.5;
    margin-bottom: 0;
}

.thought-item.success .thought-message {
    color: #166534;
    font-weight: 500;
}

.thought-item.error .thought-message {
    color: #991b1b;
    font-weight: 500;
}

/* Thought Queries List */
.thought-queries {
    margin-top: var(--spacing-sm);
    padding-left: var(--spacing-md);
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.thought-queries li {
    padding: 0.5rem 0.75rem;
    background: rgba(241, 245, 249, 0.8);
    border-left: 2px solid rgba(102, 126, 234, 0.6);
    border-radius: 4px;
    font-size: 0.8125rem;
    color: #475569;
    font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
    animation: query-slide 0.3s ease-out;
}

@keyframes query-slide {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.thought-queries li::before {
    content: '→';
    margin-right: 0.5rem;
    color: rgba(102, 126, 234, 0.8);
}

/* Responsive */
@media (max-width: 768px) {
    .thinking-modal .modal-content {
        max-width: 95%;
        margin: 1rem;
    }

    .thinking-modal-body {
        max-height: 400px;
    }
}

/* =====================================================
   Split Panel Layout (Extracted Text + AI Suggestions)
   ===================================================== */
.split-panel-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    min-height: 200px;
}

.split-panel-left,
.split-panel-right {
    display: flex;
    flex-direction: column;
}

.split-panel-heading {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.split-panel-heading::before {
    content: '';
    width: 3px;
    height: 1em;
    background: var(--accent-primary);
    border-radius: 2px;
}

.split-panel-right .split-panel-heading::before {
    background: linear-gradient(135deg, #8b5cf6, #06b6d4);
}

.ai-suggestions-panel {
    background: rgba(139, 92, 246, 0.05);
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: var(--radius-md);
    padding: 1rem;
    position: relative;
    overflow: hidden;
}

.ai-suggestions-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #8b5cf6, #06b6d4);
    opacity: 0.6;
}

.ai-suggestions-content {
    flex: 1;
    overflow-y: auto;
    max-height: 450px;
    min-height: 150px;
}

.ai-suggestions-content .ai-placeholder {
    color: var(--text-tertiary);
    font-style: italic;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 150px;
    text-align: center;
}

/* AI Suggestion Content Styling */
.ai-suggestions-content h1,
.ai-suggestions-content h2,
.ai-suggestions-content h3,
.ai-suggestions-content h4 {
    color: var(--text-primary);
    margin-top: 0.75rem;
    margin-bottom: 0.5rem;
}

.ai-suggestions-content p {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.ai-suggestions-content ul,
.ai-suggestions-content ol {
    margin: 0.5rem 0 0.75rem 1.25rem;
    color: var(--text-secondary);
}

.ai-suggestions-content li {
    margin-bottom: 0.25rem;
}

.ai-suggestions-content strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Light theme adjustments for AI suggestions */
body.light-theme .ai-suggestions-panel {
    background: rgba(139, 92, 246, 0.03);
    border-color: rgba(139, 92, 246, 0.12);
}

/* Mobile responsive for split panels */
@media (max-width: 900px) {
    .split-panel-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .ai-suggestions-panel {
        order: 2;
    }
}

/* =====================================================
   Markdown Editable Panels
   ===================================================== */
.markdown-editor-container {
    position: relative;
    min-height: 200px;
}

.panel-markdown-preview {
    min-height: 180px;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    cursor: text;
    transition: all var(--transition-base);
    overflow-y: auto;
    max-height: 500px;
}

.panel-markdown-preview:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(102, 126, 234, 0.3);
}

.panel-markdown-preview.empty {
    display: flex;
    align-items: center;
    justify-content: center;
}

.panel-markdown-preview .placeholder-text {
    color: var(--text-tertiary);
    font-style: italic;
    font-size: 0.9rem;
}

/* Markdown content styling */
.panel-markdown-preview h1,
.panel-markdown-preview h2,
.panel-markdown-preview h3,
.panel-markdown-preview h4 {
    color: var(--text-primary);
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.panel-markdown-preview h1:first-child,
.panel-markdown-preview h2:first-child,
.panel-markdown-preview h3:first-child {
    margin-top: 0;
}

.panel-markdown-preview p {
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.panel-markdown-preview ul,
.panel-markdown-preview ol {
    margin: 0.5rem 0 1rem 1.5rem;
    color: var(--text-secondary);
}

.panel-markdown-preview li {
    margin-bottom: 0.25rem;
}

.panel-markdown-preview strong {
    color: var(--text-primary);
    font-weight: 600;
}

.panel-markdown-preview code {
    background: rgba(102, 126, 234, 0.1);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
    color: var(--accent-primary);
}

.panel-markdown-preview pre {
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    margin: 1rem 0;
}

.panel-markdown-preview pre code {
    background: transparent;
    padding: 0;
    color: var(--text-secondary);
}

.panel-markdown-preview blockquote {
    border-left: 3px solid var(--accent-primary);
    padding-left: 1rem;
    margin: 1rem 0;
    color: var(--text-tertiary);
    font-style: italic;
}

.panel-markdown-preview a {
    color: var(--accent-primary);
    text-decoration: underline;
}

.panel-markdown-preview a:hover {
    color: var(--text-primary);
}

/* Citation links - clickable page references */
.panel-markdown-preview a.citation-link,
.ai-suggestions-content a.citation-link,
a.citation-link {
    color: #0891b2;
    background: rgba(8, 145, 178, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid rgba(8, 145, 178, 0.2);
}

.panel-markdown-preview a.citation-link:hover,
.ai-suggestions-content a.citation-link:hover,
a.citation-link:hover {
    background: rgba(8, 145, 178, 0.2);
    border-color: rgba(8, 145, 178, 0.4);
    color: #0e7490;
}

body.light-theme .panel-markdown-preview a.citation-link {
    color: #0e7490;
    background: rgba(8, 145, 178, 0.08);
}

/* Light theme adjustments */
body.light-theme .panel-markdown-preview {
    background: rgba(242, 245, 244, 0.6);
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-theme .panel-markdown-preview:hover {
    background: rgba(124, 58, 237, 0.01);
    border-color: rgba(58, 219, 237, 0.2);
}

body.light-theme .panel-markdown-preview code {
    background: rgba(124, 58, 237, 0.08);
    color: #7C3AED;
}

body.light-theme .panel-markdown-preview pre {
    background: rgba(0, 0, 0, 0.05);
}

/* Mobile Responsive */
/* Mobile Responsive 2025 Standards */
@media (max-width: 768px) {

    /* Layout & Container */
    .container {
        padding: 0 var(--spacing-sm);
        max-width: 100vw;
        overflow-x: hidden;
        margin-top: 5rem;
        /* Space for floating header */
    }

    /* Floating Glass Header */
    .top-nav {
        position: fixed;
        top: var(--spacing-sm);
        left: var(--spacing-sm);
        right: var(--spacing-sm);
        border-radius: 16px;
        /* Superellipse feel */
        background: rgba(15, 23, 42, 0.6);
        /* Reduced opacity for more glass */
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border: 1px solid rgba(255, 255, 255, 0.08);
        box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
        /* Deep shadow for lift */
        padding: 0.75rem 1rem;
        z-index: 1000;
        /* Reflection effect */
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0) 100%), rgba(15, 23, 42, 0.7);
    }

    /* Ensure body bg is visible through header */
    body.light-theme .top-nav {
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0.1) 100%), rgba(255, 255, 255, 0.65);
        border: 1px solid rgba(255, 255, 255, 0.4);
        box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.1);
    }

    /* Grid & Panels */
    .cases-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }

    .case-panel {
        /* Immersive Glass Card */
        margin: 0;
        width: 100%;
        border-radius: 24px;
        background: rgba(30, 41, 59, 0.4);
        /* More transparent */
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border: 1px solid rgba(255, 255, 255, 0.05);
        box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
        padding: var(--spacing-md);
        animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
        /* Smooth entry */
        opacity: 0;
        /* For animation */
        transform: translateY(20px);
    }

    /* Staggered animation for panels */
    .case-panel:nth-child(1) {
        animation-delay: 0.1s;
    }

    .case-panel:nth-child(2) {
        animation-delay: 0.2s;
    }

    .case-panel:nth-child(3) {
        animation-delay: 0.3s;
    }

    .case-panel:nth-child(4) {
        animation-delay: 0.4s;
    }

    /* Light Theme Panel Adjustments */
    /* Light Theme Panel Adjustments */
    body.light-theme .case-panel {
        background: rgba(255, 255, 255, 0.6);
        border: 1px solid rgba(255, 255, 255, 0.8);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
        position: relative;
        overflow: hidden;
    }

    body.light-theme .case-panel::after {
        content: '';
        position: absolute;
        inset: -2px;
        background: linear-gradient(45deg, #ff00cc, #3333ff, #00ccff, #ff00cc);
        background-size: 400% 400%;
        animation: rainbow-border 4s ease infinite;
        z-index: -1;
        opacity: 0;
        transition: opacity 0.3s ease;
        border-radius: 26px;
        /* slightly larger than panel radius */
    }

    body.light-theme .case-panel:hover::after {
        opacity: 1;
    }

    body.light-theme .case-panel:hover {
        transform: translateY(-2px);
        box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08);
    }

    @keyframes rainbow-border {
        0% {
            background-position: 0% 50%;
        }

        50% {
            background-position: 100% 50%;
        }

        100% {
            background-position: 0% 50%;
        }
    }

    .panel-header {
        margin-bottom: var(--spacing-md);
        padding-bottom: var(--spacing-sm);
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        /* Softer divider */
    }

    .panel-content {
        min-height: auto;
    }

    /* Typography */
    .hero-title {
        font-size: clamp(2rem, 5vw, 2.5rem);
        /* Fluid type */
        line-height: 1.1;
        letter-spacing: -0.03em;
        margin-top: 1rem;
    }

    .nav-brand .brand-name {
        font-size: 1.1rem;
    }

    .panel-header h2 {
        font-size: 1.25rem;
        letter-spacing: -0.01em;
    }

    .panel-markdown-preview {
        font-size: 1.05rem;
        /* Slightly larger for readability */
        line-height: 1.65;
        padding: 0;
        color: rgba(255, 255, 255, 0.9);
        /* High contrast */
    }

    body.light-theme .panel-markdown-preview {
        color: var(--text-primary);
    }

    .panel-markdown-preview h1 {
        font-size: 1.5rem;
        margin-top: 1.5rem;
    }

    .panel-markdown-preview h2 {
        font-size: 1.3rem;
        margin-top: 1.25rem;
    }

    .panel-markdown-preview h3 {
        font-size: 1.1rem;
        margin-top: 1rem;
    }

    /* Navigation & Actions */
    .nav-actions {
        gap: var(--spacing-xs);
    }

    .user-profile {
        padding-left: var(--spacing-xs);
        border-left: none;
        /* Remove separator for cleaner look */
    }

    .username {
        display: none;
    }

    .btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
        border-radius: 12px;
        /* Softer buttons */
    }
}

.progress-status-icon {
    font-size: 1.1em;
}

.progress-percentage {
    font-family: var(--font-mono);
    color: var(--text-tertiary);
    font-size: 0.85rem;
}

@keyframes shimmer {
    100% {
        transform: translateX(100%);
    }
}

/* Enhancements for the Thinking Modal Content */
.thinking-modal-content {
    min-height: 200px;
    display: flex;
    flex-direction: column;
}

.thinking-modal-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Styles for "Thought Items" which appear below the progress bar or replacing it */
.thought-log {
    max-height: 150px;
    overflow-y: auto;
    margin-top: var(--spacing-md);
    padding: var(--spacing-sm);
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
    font-size: 0.85rem;
}

.thought-log-item {
    margin-bottom: 4px;
    color: var(--text-tertiary);
    opacity: 0.8;
}

.thought-log-item.active {
    color: var(--text-primary);
    opacity: 1;
    font-weight: 500;
}

/* Chat Interface Styles */

.chat-fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50%;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-xl), 0 0 20px rgba(139, 92, 246, 0.4);
    z-index: 900;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: bounceIn 0.5s 1s both, chat-fab-pulse 3s ease-in-out infinite;
}

/* AI Thinking Glow Effect for Chat FAB */
@keyframes chat-fab-pulse {

    0%,
    100% {
        box-shadow:
            var(--shadow-xl),
            0 0 20px rgba(139, 92, 246, 0.5),
            0 0 40px rgba(102, 126, 234, 0.3);
    }

    33% {
        box-shadow:
            var(--shadow-xl),
            0 0 25px rgba(59, 130, 246, 0.6),
            0 0 50px rgba(59, 130, 246, 0.3);
    }

    66% {
        box-shadow:
            var(--shadow-xl),
            0 0 25px rgba(6, 182, 212, 0.6),
            0 0 50px rgba(6, 182, 212, 0.3);
    }
}

.chat-fab::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: linear-gradient(90deg,
            rgba(139, 92, 246, 0.8),
            rgba(59, 130, 246, 0.8),
            rgba(6, 182, 212, 0.8),
            rgba(139, 92, 246, 0.8));
    background-size: 300% 100%;
    animation: chat-fab-border-glow 3s ease-in-out infinite;
    z-index: -1;
    opacity: 0.7;
    filter: blur(6px);
}

@keyframes chat-fab-border-glow {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.chat-fab:hover {
    transform: scale(1.1);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    box-shadow: var(--shadow-xl), 0 0 40px rgba(139, 92, 246, 0.7);
}

.chat-fab:hover::before {
    opacity: 1;
    filter: blur(10px);
}

.chat-fab svg {
    width: 28px;
    height: 28px;
}

.chat-window {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 800px;
    height: 80vh;
    max-width: 90vw;
    max-height: 90vh;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 900;
    transform: translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

/* ... existing code ... */

/* Compact Chat Window (formerly default) */
.chat-window.compact {
    width: 400px;
    height: 600px;
}

.chat-window.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
}

.chat-header {
    padding: var(--spacing-sm) var(--spacing-md);
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-header-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.chat-avatar-circle {
    width: 36px;
    height: 36px;
    background: var(--gradient-gold);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    font-size: 0.9rem;
}

.chat-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.2;
}

.chat-status {
    font-size: 0.75rem;
    color: var(--text-accent);
}

.chat-btn-icon {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-btn-icon svg {
    width: 20px;
    height: 20px;
}

.chat-btn-icon:hover {
    color: var(--text-primary);
    background: rgba(125, 125, 125, 0.1);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
}

.chat-message {
    display: flex;
    flex-direction: column;
    max-width: 85%;
    animation: fadeIn 0.3s ease-out;
}

.chat-message.user-message {
    align-self: flex-end;
    align-items: flex-end;
}

.chat-message.ai-message {
    align-self: flex-start;
    align-items: flex-start;
}

.message-content {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.935rem;
    line-height: 1.5;
    position: relative;
    word-wrap: break-word;
}

.user-message .message-content {
    background: var(--accent-primary);
    color: #ffffff;
    border-bottom-right-radius: 2px;
}

.ai-message .message-content {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    border-bottom-left-radius: 2px;
}

.message-time {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    margin-top: 4px;
    padding: 0 4px;
}

/* Streaming cursor */
.streaming-cursor {
    display: inline-block;
    width: 6px;
    height: 14px;
    background: var(--accent-primary);
    margin-left: 2px;
    vertical-align: middle;
    animation: blink 1s infinite;
}

/* Tools / Thoughts styling */
.thought-bubble {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    font-style: italic;
    margin-bottom: 4px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
    display: inline-block;
}

.chat-input-area {
    padding: var(--spacing-md);
    border-top: 1px solid var(--glass-border);
    display: flex;
    gap: 10px;
    align-items: flex-end;
    background: rgba(255, 255, 255, 0.02);
}

#chat-input {
    flex: 1;
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 10px 16px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.935rem;
    resize: none;
    max-height: 120px;
    outline: none;
    transition: border-color 0.2s;
}

#chat-input:focus {
    border-color: var(--accent-primary);
}

#chat-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-primary);
    border: none;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

#chat-send-btn:disabled {
    background: var(--bg-tertiary);
    color: var(--text-tertiary);
    cursor: not-allowed;
}

#chat-send-btn:not(:disabled):hover {
    background: var(--accent-hover);
    transform: scale(1.05);
}

@keyframes bounceIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    60% {
        transform: scale(1.1);
        opacity: 1;
    }

    100% {
        transform: scale(1);
    }
}

/* Mobile responsive */
@media (max-width: 480px) {
    .chat-window {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
        transform: translateY(100%);
    }

    .chat-fab {
        bottom: 20px;
        right: 20px;
    }
}



/* Thinking/Breathing Effect for Chat FAB */
.chat-fab {
    animation: bounceIn 0.5s 1s both, pulse-glow 3s infinite ease-in-out;
}

@keyframes pulse-glow {
    0% {
        box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.4);
        transform: scale(1);
    }

    50% {
        box-shadow: 0 0 20px 10px rgba(139, 92, 246, 0);
        transform: scale(1.05);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(139, 92, 246, 0);
        transform: scale(1);
    }
}

.chat-fab:hover {
    animation: none;
    /* Pause breathing on hover for direct interaction feedback */
    transform: scale(1.1);
    background: var(--accent-hover);
    box-shadow: var(--shadow-xl), 0 0 30px rgba(139, 92, 246, 0.6);
}

/* Chat History Panel */
.chat-history-panel {
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 70px;
    background: var(--bg-secondary);
    z-index: 10;
    display: flex;
    flex-direction: column;
    border-radius: 0;
}

.chat-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-md);
    border-bottom: 1px solid var(--glass-border);
}

.chat-history-header h4 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.chat-history-list {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-sm);
}

.chat-history-item {
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    margin-bottom: 4px;
    background: var(--bg-tertiary);
    transition: background 0.2s;
}

.chat-history-item:hover {
    background: var(--glass-border);
}

.chat-history-item.active {
    background: var(--accent-primary);
    color: #fff;
}

.chat-history-item-title {
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-history-item-date {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.chat-history-item.active .chat-history-item-date {
    color: rgba(255, 255, 255, 0.7);
}

/* Key Judgements Cards */
.key-judgements-section {
    margin-bottom: 1rem;
}

.key-judgements-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 10px;
}

.key-judgements-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
}

.case-search-input {
    padding: 8px 12px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 0.85rem;
    width: 180px;
    outline: none;
    transition: border-color 0.2s;
}

.case-search-input:focus {
    border-color: var(--accent-primary);
}

.key-judgements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 1rem;
}

/* Agent State Loader */
.agent-state-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    gap: 1rem;
    min-height: 200px;
}

.agent-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--glass-border);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: agent-spin 1s linear infinite;
}

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

.agent-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
}

.agent-status-icon {
    font-size: 1.25rem;
    animation: agent-pulse 1.5s ease-in-out infinite;
}

@keyframes agent-pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

.agent-status-text {
    transition: opacity 0.3s ease;
}

.agent-steps {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.agent-step {
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.agent-step.pending {
    background: var(--bg-secondary);
    color: var(--text-tertiary);
    opacity: 0.6;
}

.agent-step.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
    animation: agent-step-glow 1.5s ease-in-out infinite;
}

@keyframes agent-step-glow {

    0%,
    100% {
        box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
    }

    50% {
        box-shadow: 0 4px 16px rgba(102, 126, 234, 0.6);
    }
}

.agent-step.completed {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.agent-step.completed::before {
    content: '✓ ';
}

.agent-step-arrow {
    color: var(--text-tertiary);
    font-size: 0.875rem;
    opacity: 0.5;
}

.judgement-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 14px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.judgement-card:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.judgement-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.judgement-card-link {
    position: absolute;
    top: 12px;
    right: 12px;
    color: var(--text-tertiary);
    font-size: 0.8rem;
}

.judgement-card-court,
.judgement-card-citation {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-tertiary);
    margin-bottom: 4px;
}

.judgement-card-court svg,
.judgement-card-citation svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.btn-view-all {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-tertiary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 10px 16px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-view-all:hover {
    background: var(--accent-primary);
    color: #fff;
    border-color: var(--accent-primary);
}

.btn-view-all svg {
    background: var(--accent-primary);
    border-radius: 50%;
    padding: 4px;
    color: #fff;
}

/* Saved judgement card styling */
.judgement-card.saved {
    border-color: var(--accent-primary);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.05) 0%, rgba(99, 102, 241, 0.05) 100%);
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

.judgement-card.saved::after {
    content: '✓';
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: var(--accent-primary);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
}

/* Source badge for web results */
.source-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 600;
    text-transform: uppercase;
}

.source-badge.web {
    background: var(--status-review);
    color: #fff;
}

/* ===================================
   Timeline Table Styles
   =================================== */
.timeline-table-container {
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

.timeline-table-wrapper {
    flex: 1;
    overflow-x: hidden;
    margin-bottom: var(--spacing-md);
}

.timeline-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    overflow: hidden;
    table-layout: fixed;
}

.timeline-table thead {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(99, 102, 241, 0.1) 100%);
    border-bottom: 1px solid var(--glass-border);
}

.timeline-table th {
    padding: 1rem 1.25rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.timeline-table tbody tr {
    border-bottom: 1px solid var(--glass-border);
    transition: background var(--transition-base);
}

.timeline-table tbody tr:last-child {
    border-bottom: none;
}

.timeline-table tbody tr:hover {
    background: rgba(139, 92, 246, 0.05);
}

.timeline-table td {
    padding: 1rem 1.25rem;
    vertical-align: top;
    color: var(--text-primary);
    font-size: 0.9375rem;
    line-height: 1.6;
}

/* Column widths - percentages for fixed table layout */
.timeline-col-date {
    width: 15%;
}

.timeline-col-event {
    width: 55%;
}

.timeline-col-source {
    width: 20%;
}

.timeline-col-actions {
    width: 10%;
    text-align: center;
}

/* Editable cells */
.timeline-table td[contenteditable="true"],
.timeline-table td input,
.timeline-table td textarea {
    outline: none;
    border: none;
    background: transparent;
    width: 100%;
    color: inherit;
    font-size: inherit;
    font-family: inherit;
    line-height: inherit;
    resize: none;
}

/* Event cell - use textarea for multi-line wrapping */
.timeline-cell-event {
    width: 100%;
}

.timeline-cell-event textarea {
    display: block;
    width: 100%;
    min-height: 60px;
    padding: 0.5rem;
    text-align: justify;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    overflow: hidden;
    resize: none;
    box-sizing: border-box;
}

.timeline-table td input:focus,
.timeline-table td textarea:focus,
.timeline-table td[contenteditable="true"]:focus {
    background: rgba(139, 92, 246, 0.1);
    border-radius: var(--radius-sm);
}

/* Date cell styling */
.timeline-cell-date {
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* Event cell styling */
.timeline-cell-event {
    color: var(--text-primary);
}

/* Source cell styling */
.timeline-cell-source {
    color: var(--text-tertiary);
    font-size: 0.875rem;
    font-style: italic;
}

/* Delete row button */
.btn-delete-timeline-row {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-tertiary);
    transition: all var(--transition-base);
    opacity: 0;
}

.timeline-table tbody tr:hover .btn-delete-timeline-row {
    opacity: 1;
}

.btn-delete-timeline-row:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.btn-delete-timeline-row svg {
    width: 16px;
    height: 16px;
}

/* Add Event button */
.btn-add-timeline-row {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: rgba(139, 92, 246, 0.1);
    border: 1px dashed var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
    width: 100%;
    justify-content: center;
}

.btn-add-timeline-row:hover {
    background: rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.4);
    color: var(--text-primary);
}

.btn-add-timeline-row svg {
    width: 18px;
    height: 18px;
}

/* Empty state for timeline */
.timeline-empty-state {
    padding: 2rem;
    text-align: center;
    color: var(--text-tertiary);
    font-style: italic;
}

/* Light theme adjustments */
body.light-theme .timeline-table {
    background: var(--bg-primary);
}

body.light-theme .timeline-table thead {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.08) 0%, rgba(99, 102, 241, 0.08) 100%);
}

body.light-theme .timeline-table tbody tr:hover {
    background: rgba(139, 92, 246, 0.04);
}

body.light-theme .timeline-table td input:focus,
body.light-theme .timeline-table td textarea:focus,
body.light-theme .timeline-table td[contenteditable="true"]:focus {
    background: rgba(139, 92, 246, 0.08);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .timeline-table-wrapper {
        margin: 0 -1rem;
        padding: 0 1rem;
    }

    .timeline-table th,
    .timeline-table td {
        padding: 0.75rem 1rem;
    }

    .timeline-col-source {
        display: none;
    }

    .timeline-table th.timeline-col-source,
    .timeline-table td:nth-child(3) {
        display: none;
    }
}

/* ===================================
   View Files Modal & File Cards
   =================================== */

.files-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.files-list::-webkit-scrollbar {
    width: 6px;
}

.files-list::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 3px;
}

.files-list::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 3px;
}

.files-empty,
.files-loading,
.files-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--text-tertiary);
    text-align: center;
}

.files-loading .spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--bg-tertiary);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 1rem;
}

.files-error {
    color: var(--status-closed);
}

.file-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

.file-card:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 4px 12px rgba(129, 140, 248, 0.1);
}

.file-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    min-width: 0;
}

.file-icon {
    width: 40px;
    height: 40px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.file-icon svg {
    width: 20px;
    height: 20px;
    color: var(--accent-primary);
}

.file-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.file-name {
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.935rem;
}

.file-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

.file-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.file-badge.english {
    background: rgba(52, 211, 153, 0.15);
    color: var(--status-active);
}

.file-badge.translated {
    background: rgba(96, 165, 250, 0.15);
    color: var(--status-review);
}

.file-badge.scanned {
    background: rgba(251, 146, 60, 0.15);
    color: var(--status-pending);
}

.file-badge.ocr-pending {
    background: rgba(251, 191, 36, 0.15);
    color: #f59e0b;
}

.file-badge.ocr-processing {
    background: rgba(99, 102, 241, 0.15);
    color: #6366f1;
    animation: ocr-pulse 1.5s ease-in-out infinite;
}

@keyframes ocr-pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

.file-badge.ocr-failed {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.ocr-progress-container {
    width: 100%;
    height: 4px;
    background: var(--bg-secondary);
    border-radius: 2px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.ocr-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2, #667eea);
    background-size: 200% 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
    animation: ocr-progress-shimmer 2s ease-in-out infinite;
}

@keyframes ocr-progress-shimmer {
    0% {
        background-position: 0% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.file-processing-note {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    font-style: italic;
}

.file-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.btn-file-download {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 0.85rem;
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-file-download:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--accent-primary);
}

.btn-file-download.primary {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.btn-file-download.primary:hover {
    background: var(--accent-hover);
}

/* Light theme adjustments */
body.light-theme .file-card {
    background: rgba(255, 255, 255, 0.8);
}

body.light-theme .file-icon {
    background: var(--bg-secondary);
}

body.light-theme .btn-file-download {
    background: white;
    color: #1e293b;
    /* Dark text for visibility */
    border-color: #cbd5e1;
}

body.light-theme .btn-file-download:hover {
    background: #f1f5f9;
    border-color: var(--accent-primary);
}

body.light-theme .btn-file-download.primary {
    background: var(--accent-primary);
    color: white;
}

/* ===================================
   Predictions Panel - Horizontal Timeline
   =================================== */

.case-stage-panel-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.case-stage-actions {
    text-align: center;
    padding: 1rem 0;
}

.case-stage-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    gap: 1rem;
}

.case-stage-loading .spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--bg-tertiary);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.case-stage-timeline-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Predictions Header - Professional Layout */
.case-stage-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

/* Restored & Refined Pill Badge */
.current-stage-badge {
    display: inline-flex;
    align-items: center;
    gap: 1.25rem;
    padding: 0.8rem 1.75rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 100px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1), inset 0 1px 1px rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.current-stage-badge:hover {
    border-color: rgba(139, 92, 246, 0.4);
    box-shadow: 0 8px 32px rgba(139, 92, 246, 0.15);
}

.current-stage-badge .badge-label {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    white-space: nowrap;
}

.current-stage-badge .badge-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--accent-primary);
    line-height: 1.4;
}

/* Regenerate Button - Professional Modern Style */
.regenerate-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1.25rem;
    background: #000000;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: var(--shadow-md);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.regenerate-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    pointer-events: none;
    animation: btn-shimmer 6s ease-in-out infinite;
}

.regenerate-btn:hover {
    background: #1a1a1a;
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px);
}

.regenerate-btn:active {
    transform: translateY(1px);
}

.regenerate-btn .btn-icon {
    font-size: 1.1rem;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    background: none;
    border: none;
    padding: 0;
}

.regenerate-btn:hover .btn-icon {
    transform: rotate(180deg);
}

.regenerate-btn:disabled {
    opacity: 0.5;
    cursor: wait;
}

/* Horizontal Timeline */
.horizontal-timeline-wrapper {
    overflow-x: auto;
    padding: 1rem 0;
    margin: 0 -1rem;
    padding-left: 1rem;
    padding-right: 1rem;
}

.horizontal-timeline {
    display: flex;
    align-items: flex-start;
    gap: 0;
    min-width: max-content;
    padding: 1rem 0;
}

.timeline-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 140px;
    position: relative;
}

.timeline-node:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 20px;
    left: calc(50% + 25px);
    width: calc(100% - 50px);
    height: 3px;
    background: var(--glass-border);
}

.timeline-node.completed:not(:last-child)::after {
    background: linear-gradient(90deg, #10b981, #10b981);
}

.timeline-node.current:not(:last-child)::after {
    background: linear-gradient(90deg, var(--accent-primary), var(--glass-border));
}

.node-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}

.timeline-node.completed .node-circle {
    background: #10b981;
    color: white;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

.timeline-node.current .node-circle {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.5);
    animation: current-stage-pulse 2s ease-in-out infinite;
}

@keyframes current-stage-pulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 4px 16px rgba(102, 126, 234, 0.5);
    }

    50% {
        transform: scale(1.1);
        box-shadow: 0 6px 24px rgba(102, 126, 234, 0.7);
    }
}

.timeline-node.upcoming .node-circle {
    background: var(--bg-tertiary);
    color: var(--text-tertiary);
    border: 2px dashed var(--glass-border);
}

.node-label {
    margin-top: 0.5rem;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: center;
    max-width: 90px;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-wrap: break-word;
}

.timeline-node.current .node-label {
    color: var(--accent-primary);
    font-weight: 600;
}

.timeline-node.upcoming .node-label {
    color: var(--text-tertiary);
    opacity: 0.7;
}

.node-info {
    margin-top: 0.35rem;
    font-size: 0.65rem;
    color: var(--text-tertiary);
    text-align: center;
    max-width: 90px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Expanded state on click */
.node-label.expanded {
    -webkit-line-clamp: unset;
    line-clamp: unset;
    max-width: 200px;
    background: var(--bg-tertiary);
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 10;
}

/* Hover tooltip effect */
.timeline-node:hover .node-label {
    opacity: 1;
    color: var(--text-primary);
}

/* Stage Details Card - Premium */
.stage-details-card {
    background: linear-gradient(135deg, rgba(30, 30, 40, 0.6) 0%, rgba(20, 20, 30, 0.8) 100%);
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.stage-details-card h4 {
    margin: 0 0 0.75rem 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stage-details-card h4::before {
    content: '📍';
    font-size: 1rem;
}

.stage-details-card p {
    margin: 0;
    color: var(--text-primary);
    line-height: 1.7;
    font-size: 0.95rem;
}

/* Next Steps Section - Premium */
.next-steps-section {
    background: linear-gradient(135deg, rgba(30, 30, 40, 0.6) 0%, rgba(20, 20, 30, 0.8) 100%);
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.next-steps-section h4 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.next-steps-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.next-step-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--accent-primary);
}

.next-step-item.high-priority {
    border-left-color: #ef4444;
}

.next-step-item.medium-priority {
    border-left-color: #f59e0b;
}

.next-step-item.low-priority {
    border-left-color: #10b981;
}

.next-step-priority {
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    flex-shrink: 0;
}

.next-step-priority.high {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.next-step-priority.medium {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.next-step-priority.low {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.next-step-content {
    flex: 1;
}

.next-step-action {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.next-step-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.next-step-deadline {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 0.25rem;
}

/* Alternate Timelines Section */
.alternate-timelines-section {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.05) 0%, rgba(99, 102, 241, 0.05) 100%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
}

.alternate-timelines-section h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.alternate-timelines-section .section-description {
    margin: 0 0 1.25rem 0;
    font-size: 0.875rem;
    color: var(--text-tertiary);
}

.alternate-timelines-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.alternate-timeline-card {
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.timeline-decision-header {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15) 0%, rgba(99, 102, 241, 0.15) 100%);
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--glass-border);
}

.timeline-decision-header h5 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.timeline-paths-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--glass-border);
}

.timeline-path {
    background: var(--bg-tertiary);
    padding: 1.25rem;
}

.timeline-path.path-a {
    border-right: 1px solid var(--glass-border);
}

.path-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.path-choice {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.path-probability {
    padding: 0.2rem 0.5rem;
    background: rgba(139, 92, 246, 0.15);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--accent-primary);
}

.path-stages {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.path-stage {
    padding: 0.25rem 0.6rem;
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.path-stage:not(:last-child)::after {
    content: '→';
    margin-left: 0.5rem;
    color: var(--text-tertiary);
}

.path-pros-cons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    font-size: 0.8rem;
}

.path-pros h6,
.path-cons h6 {
    margin: 0 0 0.35rem 0;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.path-pros h6 {
    color: #10b981;
}

.path-cons h6 {
    color: #ef4444;
}

.path-pros ul,
.path-cons ul {
    margin: 0;
    padding-left: 1.25rem;
    color: var(--text-secondary);
}

.path-pros li,
.path-cons li {
    margin-bottom: 0.2rem;
}

/* Analysis Notes */
.analysis-notes {
    background: var(--bg-tertiary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
}

.analysis-notes h4 {
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.analysis-notes p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Responsive */
@media (max-width: 768px) {
    .timeline-paths-container {
        grid-template-columns: 1fr;
    }

    .timeline-path.path-a {
        border-right: none;
        border-bottom: 1px solid var(--glass-border);
    }

    .horizontal-timeline-wrapper {
        margin: 0 -0.5rem;
        padding-left: 0.5rem;
    }

    .timeline-node {
        min-width: 100px;
    }

    .node-circle {
        width: 32px;
        height: 32px;
        font-size: 0.875rem;
    }

    .node-label {
        font-size: 0.7rem;
        max-width: 90px;
    }
}

/* Light theme */
body.light-theme .current-stage-badge {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(99, 102, 241, 0.1) 100%);
}

body.light-theme .stage-details-card,
body.light-theme .next-steps-section,
body.light-theme .analysis-notes {
    background: rgba(255, 255, 255, 0.8);
}

body.light-theme .alternate-timelines-section {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.03) 0%, rgba(99, 102, 241, 0.03) 100%);
}

body.light-theme .alternate-timeline-card {
    background: white;
}

body.light-theme .timeline-path {
    background: rgba(255, 255, 255, 0.8);
}

/* ===================================
   Branching Timeline Visualization
   =================================== */

.branching-timeline {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    padding: 1rem 0;
    width: 100%;
}

/* Main Path (before decision) */
.timeline-main-path {
    display: flex;
    align-items: flex-start;
    gap: 0;
    overflow-x: auto;
    padding: 1rem;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}

.timeline-main-path::-webkit-scrollbar {
    height: 6px;
}

.timeline-main-path::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 3px;
}

.timeline-main-path .timeline-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 100px;
    max-width: 100px;
    position: relative;
    flex-shrink: 0;
}

.timeline-main-path .timeline-node:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 16px;
    left: calc(50% + 18px);
    width: calc(100% - 36px);
    height: 2px;
    background: var(--glass-border);
}

.timeline-main-path .timeline-node.completed:not(:last-child)::after {
    background: linear-gradient(90deg, #10b981, #059669);
}

.timeline-main-path .timeline-node.current:not(:last-child)::after {
    background: linear-gradient(90deg, var(--accent-primary), var(--glass-border));
}

/* Decision Point Container - Premium */
.timeline-decision-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin-top: 1.5rem;
    padding-top: 1rem;
}

.decision-point-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 2rem;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15) 0%, rgba(99, 102, 241, 0.1) 100%);
    border: 1px solid rgba(139, 92, 246, 0.4);
    border-radius: 16px;
    position: relative;
    box-shadow: 0 8px 32px rgba(139, 92, 246, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.decision-point-node::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 50%;
    width: 3px;
    height: 20px;
    background: var(--accent-primary);
    transform: translateX(-50%);
}

.decision-icon {
    font-size: 1.5rem;
}

.decision-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    max-width: 300px;
}

/* Parallel Branches */
.parallel-branches {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.5rem;
    position: relative;
    justify-content: center;
    width: 100%;
}

.parallel-branches::before {
    content: '';
    position: absolute;
    top: -1.5rem;
    left: 50%;
    width: 50%;
    height: 2px;
    background: linear-gradient(90deg, rgba(139, 92, 246, 0.5), rgba(99, 102, 241, 0.5));
    transform: translateX(-50%);
}

.branch-path {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 200px;
    max-width: 320px;
    flex: 1;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, rgba(30, 30, 40, 0.7) 0%, rgba(20, 20, 30, 0.9) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.branch-path:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(139, 92, 246, 0.25);
}

.branch-path::before {
    content: '';
    position: absolute;
    top: -1.5rem;
    left: 50%;
    width: 2px;
    height: 1.5rem;
    background: linear-gradient(180deg, rgba(139, 92, 246, 0.3), rgba(139, 92, 246, 0.6));
    transform: translateX(-50%);
}

.branch-path.path-a {
    border-top: 3px solid #10b981;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.15);
}

.branch-path.path-b {
    border-top: 3px solid #f59e0b;
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.15);
}

/* Branch Header */
.branch-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 0.5rem;
    gap: 0.5rem;
    flex-wrap: wrap;
    overflow: hidden;
}

/* Predictions Panel Header */
#panel-casestage .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

#panel-casestage .header-content {
    flex: 1;
}

#panel-casestage .regenerate-btn {
    margin-left: 1rem;
    margin-top: 0.25rem;
}

.branch-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.branch-id {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
    color: white;
    flex-shrink: 0;
}

.path-a .branch-id {
    background: #10b981;
}

.path-b .branch-id {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.branch-choice {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

/* Win Probability Badge - Premium */
.win-probability {
    padding: 0.4rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, #667eea, #764ba2);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
    letter-spacing: 0.02em;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 0;
}

.win-probability.high {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

.win-probability.medium {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

.win-probability.low {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

/* Long probability text in detail cards - allow wrapping */
.branch-detail-header .win-probability {
    white-space: normal;
    word-wrap: break-word;
    max-width: 120px;
    text-align: center;
    line-height: 1.3;
    flex-shrink: 0;
}

/* Branch Stages */
.branch-stages {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    margin-top: 0.5rem;
}

.branch-stage-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.6rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.branch-stage-item::before {
    content: '→';
    color: var(--text-tertiary);
}

.branch-outcome {
    margin-top: 0.75rem;
    padding: 0.5rem;
    background: rgba(139, 92, 246, 0.1);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: var(--accent-primary);
    font-weight: 500;
    text-align: center;
    width: 100%;
}

/* Branch Details Section */
.branch-details-section {
    background: var(--bg-tertiary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
}

.branch-details-section h4 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.branch-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.branch-detail-card {
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 1rem;
    border-top: 3px solid var(--accent-primary);
}

.branch-detail-card.path-a {
    border-top-color: #10b981;
}

.branch-detail-card.path-b {
    border-top-color: #f59e0b;
}

.branch-detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    gap: 0.5rem;
    flex-wrap: wrap;
    overflow: hidden;
}

.branch-detail-title {
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
    min-width: 0;
    word-wrap: break-word;
    line-height: 1.3;
}

.branch-pros-cons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.branch-pros h6,
.branch-cons h6 {
    margin: 0 0 0.3rem 0;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.branch-pros h6 {
    color: #10b981;
}

.branch-cons h6 {
    color: #ef4444;
}

.branch-pros ul,
.branch-cons ul {
    margin: 0;
    padding-left: 1.1rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.branch-pros li,
.branch-cons li {
    margin-bottom: 0.15rem;
}

/* Responsive */
@media (max-width: 768px) {
    .parallel-branches {
        flex-direction: column;
        gap: 1rem;
    }

    .parallel-branches::before {
        display: none;
    }

    .branch-path {
        min-width: 100%;
    }

    .branch-path::before {
        display: none;
    }
}

/* Light theme */
body.light-theme .decision-point-node {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(99, 102, 241, 0.1) 100%);
}

body.light-theme .branch-path {
    background: rgba(255, 255, 255, 0.9);
}

body.light-theme .branch-details-section {
    background: rgba(255, 255, 255, 0.8);
}

body.light-theme .branch-detail-card {
    background: white;
}

/* ===================================
   Judgement Summary Modal
   =================================== */
.judgement-summary-details {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.judgement-summary-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
}

.judgement-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.judgement-meta-item svg {
    color: var(--accent-primary);
    flex-shrink: 0;
}

.judgement-summary-content {
    padding: 1.25rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
    line-height: 1.7;
    color: var(--text-primary);
    font-size: 0.95rem;
    max-height: 300px;
    overflow-y: auto;
}

.judgement-summary-content p {
    margin: 0;
}

/* Scrollbar for summary content */
.judgement-summary-content::-webkit-scrollbar {
    width: 6px;
}

.judgement-summary-content::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 3px;
}

.judgement-summary-content::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 3px;
}

/* Non-web badge for judgement cards */
.judgement-card .view-summary-hint {
    position: absolute;
    bottom: 8px;
    left: 8px;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 500;
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-primary);
    opacity: 0;
    transition: opacity 0.2s;
}

.judgement-card:hover .view-summary-hint {
    opacity: 1;
}

/* Light theme adjustments */
body.light-theme .judgement-summary-meta,
body.light-theme .judgement-summary-content {
    background: rgba(255, 255, 255, 0.8);
}


/* ========================================================================== */
/* GLOBAL TOP NAVIGATION & PRACTICE AREA TABS                                  */
/* ========================================================================== */

.global-top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-lg);
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.practice-area-tabs {
    display: flex;
    gap: var(--spacing-xs);
    background: rgba(0, 0, 0, 0.2);
    padding: 4px;
    border-radius: var(--radius-lg);
}

body.light-theme .practice-area-tabs {
    background: rgba(0, 0, 0, 0.05);
}

.practice-tab {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: 0.6rem 1.25rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
}

.practice-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

body.light-theme .practice-tab:hover {
    background: rgba(0, 0, 0, 0.05);
}

.practice-tab.active {
    background: var(--accent-primary);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.practice-tab svg {
    flex-shrink: 0;
}

.practice-tab.disabled {
    opacity: 0.7;
    cursor: default;
}

.coming-soon-badge {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-primary);
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 4px;
    font-weight: 600;
    border: 1px solid rgba(99, 102, 241, 0.2);
    text-transform: uppercase;
}

/* Practice Area App Containers */
.practice-area-app {
    display: none;
}

.practice-area-app.active {
    display: block;
}

.ma-panel {
    display: none;
    height: 100%;
    flex-direction: column;
}

.ma-panel.active {
    display: flex;
}

/* Clause Review */
.clause-review-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: var(--spacing-md);
    padding-top: var(--spacing-md);
}

/* Clause Review Refinements */
.clause-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    transition: all 0.3s ease;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.clause-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(129, 140, 248, 0.3);
}

.clause-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--glass-border);
    transition: background 0.3s ease;
}

.clause-card:hover::before {
    background: var(--accent-primary);
}

.clause-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: var(--spacing-sm);
    margin-bottom: var(--spacing-xs);
}

.clause-type {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.clause-risk {
    font-size: 0.7rem;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.risk-red {
    background: rgba(248, 113, 113, 0.15);
    color: #f87171;
    border: 1px solid rgba(248, 113, 113, 0.2);
}

.risk-amber {
    background: rgba(251, 146, 60, 0.15);
    color: #fb923c;
    border: 1px solid rgba(251, 146, 60, 0.2);
}

.risk-green {
    background: rgba(52, 211, 153, 0.15);
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, 0.2);
}

.clause-text-box {
    background: rgba(0, 0, 0, 0.04);
    /* Subtle dark tint for contrast on white */
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    padding: var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-family: 'Space Mono', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-primary);
    min-height: 100px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    /* Darker border for definition */
    white-space: pre-wrap;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.03);
    /* Subtle inner depth */
}

.market-comp {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    font-style: italic;
    background: rgba(255, 255, 255, 0.02);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    border-left: 2px solid var(--text-tertiary);
}

.clause-actions {
    display: flex;
    gap: 10px;
    margin-top: var(--spacing-sm);
}

.clause-btn {
    flex: 1;
    padding: 8px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
    cursor: pointer;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-accept {
    background: rgba(52, 211, 153, 0.1);
    color: #34d399;
    border-color: rgba(52, 211, 153, 0.2);
}

.btn-accept:hover {
    background: rgba(52, 211, 153, 0.2);
    transform: translateY(-1px);
}

.btn-reject {
    background: rgba(248, 113, 113, 0.1);
    color: #f87171;
    border-color: rgba(248, 113, 113, 0.2);
}

.btn-reject:hover {
    background: rgba(248, 113, 113, 0.2);
    transform: translateY(-1px);
}

.btn-edit {
    background: rgba(129, 140, 248, 0.1);
    color: #818cf8;
    border-color: rgba(129, 140, 248, 0.2);
}

.btn-edit:hover {
    background: rgba(129, 140, 248, 0.2);
    transform: translateY(-1px);
}

/* DD Copilot Dashboard (Risks) */
.dd-dashboard {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-md);
    height: 100%;
}

.risk-column {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(10px);
}

.risk-column h4 {
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid;
    text-align: center;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.risk-column.risk-red h4 {
    border-color: #f87171;
    color: #f87171;
}

.risk-column.risk-amber h4 {
    border-color: #fb923c;
    color: #fb923c;
}

.risk-column.risk-green h4 {
    border-color: #34d399;
    color: #34d399;
}


.risk-list {
    list-style: none;
    overflow-y: auto;
    flex: 1;
}

.risk-item {
    background: var(--glass-bg);
    margin-bottom: 8px;
    padding: 10px;
    border-radius: 4px;
    font-size: 0.9rem;
    border-left: 3px solid transparent;
}

.risk-column.risk-red .risk-item {
    border-left-color: #f87171;
}

.risk-column.risk-amber .risk-item {
    border-left-color: #fb923c;
}

.risk-column.risk-green .risk-item {
    border-left-color: #34d399;
}

/* Chat */
.ma-chat-sidebar .chat-header {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--glass-border);
    font-weight: 600;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ma-chat-message {
    display: flex;
    gap: 10px;
}

.message-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
    flex-shrink: 0;
}

.message-body {
    background: var(--bg-tertiary);
    padding: 8px 12px;
    border-radius: 12px;
    border-top-left-radius: 2px;
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--text-primary);
}

.chat-input-area {
    padding: var(--spacing-md);
    border-top: 1px solid var(--glass-border);
    display: flex;
    gap: 8px;
}

#ma-chat-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 8px 12px;
    color: white;
}

/* DD Workspace Split Layout */
.dd-workspace-container {
    display: flex;
    gap: 20px;
    height: auto;
    /* Allow to grow with content */
    align-items: flex-start;
    /* Important for sticky sidebar */
    overflow: visible !important;
}

.dd-doc-sidebar {
    width: 300px;
    flex-shrink: 0;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Sticky positioning */
    position: -webkit-sticky;
    position: sticky;
    top: 20px;
    height: calc(100vh - 100px);
    /* Adjust based on header height */
}

.dd-doc-sidebar-header {
    padding: 15px;
    border-bottom: 1px solid var(--glass-border);
    font-weight: 600;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

.dd-doc-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.dd-doc-item {
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dd-doc-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.dd-doc-item.active {
    background: rgba(100, 255, 218, 0.1);
    border-color: var(--accent-primary);
}

.dd-doc-name {
    font-size: 0.9rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dd-doc-item.active .dd-doc-name {
    color: var(--text-primary);
}

.dd-risk-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    letter-spacing: 0.02em;
    transition: all 0.2s ease;
}

.dd-risk-badge.has-risk {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.dd-risk-badge.risk-red {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(220, 38, 38, 0.25));
    color: #f87171;
    border: 1px solid rgba(248, 113, 113, 0.3);
}

.dd-risk-badge.risk-amber {
    background: linear-gradient(135deg, rgba(251, 146, 60, 0.2), rgba(245, 158, 11, 0.25));
    color: #fb923c;
    border: 1px solid rgba(251, 146, 60, 0.3);
}

.dd-risk-badge.risk-green {
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.15), rgba(16, 185, 129, 0.2));
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, 0.25);
}

.dd-risk-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
    flex-shrink: 0;
}

/* Right Side - Clause List */
.dd-clause-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding-bottom: 40px;
    /* Allow resizing */
    height: auto;
    overflow: visible;
}

.dd-empty-select {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-secondary);
    font-style: italic;
    border: 2px dashed var(--glass-border);
    border-radius: 12px;
}

/* Fix for DD Workspace Layout */
.ma-clause-content {
    display: flex;
    flex-direction: column;
    height: auto;
    /* Infinite height */
    overflow: visible;
}

.clause-review-container {
    display: flex !important;
    gap: 0 !important;
    flex: 1;
    width: 100%;
    height: auto;
    overflow: visible !important;
    grid-template-columns: none !important;
}

/* Ensure right col doesn't overflow flex parent */
.dd-clause-content {
    min-width: 0;
}

/* ===========================================
   SUBSCRIPTION & PAYWALL STYLES
   =========================================== */

/* Subscription Badge */
.subscription-badge {
    font-size: 0.625rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
    margin-left: 0.5rem;
}

.subscription-badge.free {
    background: rgba(156, 163, 175, 0.2);
    color: #9CA3AF;
}

.subscription-badge.pro {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(236, 72, 153, 0.2));
    color: #A855F7;
}

.subscription-badge.trial {
    background: rgba(34, 197, 94, 0.2);
    color: #22C55E;
}

/* Trial Banner */
.trial-banner {
    background: linear-gradient(90deg, #1e1b4b, #312e81);
    border-bottom: 1px solid rgba(99, 102, 241, 0.3);
    padding: 0.75rem 1rem;
    position: fixed;
    top: 75px;
    left: 0;
    right: 0;
    z-index: 99;
}

.trial-banner-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

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

.trial-text {
    font-size: 0.875rem;
    color: #e2e8f0;
}

.trial-text strong {
    color: var(--accent-primary);
}

.btn-upgrade-banner {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-upgrade-banner:hover {
    transform: scale(1.05);
}

.btn-dismiss-banner {
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
}

.btn-dismiss-banner:hover {
    color: var(--text-primary);
}

/* Dropdown Section */
.dropdown-section {
    padding: 0.75rem 1rem;
}

.dropdown-divider {
    height: 1px;
    background: var(--glass-border);
    margin: 0.5rem 0;
}

.subscription-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.tier-label {
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 600;
}

.trial-days {
    font-size: 0.75rem;
    color: var(--accent-primary);
}

.btn-upgrade {
    width: 100%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border: none;
    padding: 0.625rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.btn-upgrade:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* Manage Subscription Button */
.btn-manage-subscription {
    width: 100%;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--glass-border);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
    margin-top: 0.5rem;
}

.btn-manage-subscription:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border-color: var(--accent-primary);
}

.btn-manage-subscription svg {
    flex-shrink: 0;
}


#upgrade-modal,
#paywall-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

/* Upgrade Modal Content */
.upgrade-modal-content {
    background: var(--bg-tertiary);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    padding: 2rem;
    position: relative;
    animation: scaleIn 0.3s ease;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.upgrade-header {
    margin-bottom: 1.5rem;
}

.upgrade-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.upgrade-header h2 {
    font-size: 1.75rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.upgrade-header p {
    font-size: 0.935rem;
    color: var(--text-secondary);
}

.upgrade-features {
    text-align: left;
    margin-bottom: 1.5rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--glass-border);
}

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

.feature-item span {
    font-size: 0.935rem;
    color: var(--text-primary);
}

.upgrade-pricing {
    margin-bottom: 1.5rem;
}

.price-tag {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.25rem;
}

.price-tag .currency {
    font-size: 1.5rem;
    color: var(--text-secondary);
}

.price-tag .amount {
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-primary);
}

.price-tag .period {
    font-size: 1rem;
    color: var(--text-secondary);
}

.btn-pay-razorpay {
    width: 100%;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: white;
    border: none;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all 0.2s;
}

.btn-pay-razorpay:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.3);
}

.payment-note {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 1rem;
}

/* Paywall Modal */
.paywall-modal-content {
    background: var(--bg-tertiary);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    padding: 2rem;
    position: relative;
    animation: scaleIn 0.3s ease;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.paywall-header {
    margin-bottom: 1.5rem;
}

.paywall-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.paywall-header h2 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.paywall-header p {
    font-size: 0.935rem;
    color: var(--text-secondary);
}

.paywall-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.paywall-actions .btn-primary {
    width: 100%;
}

.paywall-actions .btn-secondary {
    width: 100%;
}

/* Adjust main content when trial banner is shown */
body.trial-active .container {
    padding-top: 40px;
}

/* ===================================
   Database Loading Overlay
   =================================== */
.db-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.1s ease, visibility 0.1s ease;
}

.db-loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.db-loading-content {
    text-align: center;
    color: white;
}

.db-spinner {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.db-loading-content p {
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
}

/* ============================================
   2026 UI Enhancements
   Performance, Accessibility & Modern Effects
   ============================================ */

/* CSS Containment for Layout Performance */
.case-card {
    contain: layout style;
}

.panel {
    contain: content;
}

.modal-content {
    contain: layout;
}

/* Modern Micro-interactions with Smooth Curves */
/* Conflicting transition/hover removed */

/* Haptic-style Feedback on Button Press */
.btn-primary:active,
.btn-secondary:active {
    transform: scale(0.97);
    transition: transform 50ms ease;
}

/* Enhanced Focus Visible for Keyboard Navigation (A11y) */
.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.panel-tab:focus-visible,
.case-card:focus-visible,
.nav-link:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 3px;
}

.panel-tab:focus-visible {
    border-radius: var(--radius-md);
}

/* Reduced motion override removed for debugging/user preference */

/* Scroll-Driven Animations (2024+ Browser Feature) */
@supports (animation-timeline: view()) {
    .case-card {
        animation: card-reveal linear both;
        animation-timeline: view();
        animation-range: entry 0% entry 40%;
    }

    @keyframes card-reveal {
        from {
            opacity: 0;
            transform: translateY(24px) scale(0.96);
        }

        to {
            opacity: 1;
            transform: translateY(0) scale(1);
        }
    }

    /* Stagger effect for grid items */
    .case-card:nth-child(3n+2) {
        animation-range: entry 5% entry 45%;
    }

    .case-card:nth-child(3n+3) {
        animation-range: entry 10% entry 50%;
    }
}

/* Conflicting styles removed to favor the new 2026 implementation above */

/* Panel Tab Active State Enhancement */
.panel-tab.active {
    box-shadow:
        0 2px 8px rgba(99, 102, 241, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

/* Smooth Panel Transitions */
.panel {
    transition: opacity 200ms ease;
}

.panel.active {
    animation: panel-enter 250ms ease-out;
}

@keyframes panel-enter {
    from {
        opacity: 0;
        transform: translateX(8px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ===========================================
   SUMMARY PANEL STYLES (AI-Powered)
   =========================================== */

/* AI Badge in header */
.ai-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    font-size: 0.625rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-left: 0.5rem;
    vertical-align: middle;
    animation: badge-pulse 2s ease-in-out infinite;
}

@keyframes badge-pulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4);
    }

    50% {
        box-shadow: 0 0 0 6px rgba(99, 102, 241, 0);
    }
}

/* Clerk Notes Container */
.clerk-notes-container {
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

/* Loading State */
.clerk-notes-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl);
    color: var(--text-secondary);
    min-height: 300px;
}

.clerk-notes-loading .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: var(--spacing-md);
}

.clerk-notes-loading p {
    font-size: 0.9rem;
    color: var(--text-tertiary);
}

/* Empty State */
.clerk-notes-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--spacing-xl);
    min-height: 300px;
    color: var(--text-secondary);
}

.clerk-notes-empty .empty-icon {
    margin-bottom: var(--spacing-md);
    opacity: 0.5;
}

.clerk-notes-empty .empty-icon svg {
    stroke: var(--accent-primary);
}

.clerk-notes-empty h3 {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
    font-weight: 600;
}

.clerk-notes-empty p {
    font-size: 0.9rem;
    color: var(--text-tertiary);
    max-width: 400px;
    line-height: 1.6;
}

/* Notes Content */
.clerk-notes-content {
    padding: var(--spacing-md);
}

.clerk-notes-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

/* Individual Clerk Note Item */
.clerk-note-item {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    backdrop-filter: blur(10px);
    transition: all 0.2s ease;
}

.clerk-note-item:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1);
}

.clerk-note-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--glass-border);
}

.clerk-note-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.clerk-note-icon svg {
    width: 16px;
    height: 16px;
    stroke: white;
}

.clerk-note-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.clerk-note-category {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-primary);
    font-weight: 600;
}

.clerk-note-body {
    font-size: 0.875rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.clerk-note-body ul,
.clerk-note-body ol {
    margin-left: var(--spacing-md);
    margin-top: 0.5rem;
}

.clerk-note-body li {
    margin-bottom: 0.5rem;
}

.clerk-note-body strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Light theme adjustments */
body.light-theme .ai-badge {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

body.light-theme .clerk-note-item {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(203, 213, 225, 0.5);
}

body.light-theme .clerk-note-item:hover {
    background: rgba(255, 255, 255, 0.95);
}

body.light-theme .clerk-notes-empty .empty-icon svg {
    stroke: #6366f1;
}

/* =============================================
   Case Entities Visualization Styles
   ============================================= */

/* View Mode Tabs */
.kg-view-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.kg-view-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.kg-view-tab:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.kg-view-tab.active {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-color: transparent;
    color: white;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.kg-view-tab svg {
    width: 16px;
    height: 16px;
}

/* Entity Type Filter Bar */
.kg-filter-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.kg-filter-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    font-size: 0.8rem;
}

.kg-filter-checkbox input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
}

.kg-filter-checkbox span {
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 500;
    font-size: 0.75rem;
    transition: all 0.2s ease;
}

.kg-filter-checkbox input:not(:checked)+span {
    opacity: 0.4;
    text-decoration: line-through;
}

/* View Containers */
.kg-view-container {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Interactive Graph Container */
#kg-network-container {
    background: linear-gradient(135deg, #fafafa 0%, #f5f5f5 100%);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}

body.light-theme #kg-network-container {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
}

#kg-network-legend {
    position: absolute;
    top: 10px;
    right: 10px;
    background: white;
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    font-size: 0.75rem;
    z-index: 10;
    max-width: 140px;
}

/* Timeline Styles */
#kg-timeline-container {
    position: relative;
    padding-left: 40px;
}

#kg-timeline-container::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #6366f1, #8b5cf6, #a855f7);
    border-radius: 3px;
}

.kg-timeline-event {
    position: relative;
    padding: 15px 20px;
    margin-bottom: 20px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.kg-timeline-event:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    border-color: var(--accent-primary);
}

.kg-timeline-event::before {
    content: '';
    position: absolute;
    left: -32px;
    top: 20px;
    width: 12px;
    height: 12px;
    background: #6366f1;
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.kg-timeline-date {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6366f1;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 5px;
}

.kg-timeline-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.kg-timeline-entities {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.kg-timeline-entity-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: var(--bg-secondary);
    border-radius: 12px;
    font-size: 0.7rem;
    color: var(--text-secondary);
}

/* Split View Styles */
.kg-split-column {
    min-height: 200px;
}

.kg-split-column h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid currentColor;
    opacity: 0.9;
}

.kg-split-item {
    padding: 12px 15px;
    background: white;
    border-radius: 8px;
    border-left: 3px solid currentColor;
    margin-bottom: 10px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.kg-split-item:hover {
    transform: translateX(3px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.kg-split-item-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.kg-split-item-detail {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.kg-split-item-strength {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-top: 6px;
}

.kg-split-item-strength.strong {
    background: rgba(34, 197, 94, 0.15);
    color: #16a34a;
}

.kg-split-item-strength.medium {
    background: rgba(234, 179, 8, 0.15);
    color: #ca8a04;
}

.kg-split-item-strength.weak {
    background: rgba(239, 68, 68, 0.15);
    color: #dc2626;
}

/* Enhanced Entity Modal */
.entity-modal-group {
    margin-bottom: 20px;
}

.entity-modal-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.entity-modal-group-header.prosecution {
    color: #dc2626;
}

.entity-modal-group-header.defense {
    color: #16a34a;
}

.entity-modal-group-header.neutral {
    color: #6b7280;
}

.connection-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-left: auto;
}

.connection-badge.strong {
    background: rgba(34, 197, 94, 0.15);
    color: #16a34a;
}

.connection-badge.medium {
    background: rgba(234, 179, 8, 0.15);
    color: #ca8a04;
}

.connection-badge.weak {
    background: rgba(239, 68, 68, 0.15);
    color: #dc2626;
}

/* Empty state for split view */
.kg-split-empty {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.9rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .kg-view-tabs {
        justify-content: center;
    }

    .kg-view-tab {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .kg-view-tab span:not(.tab-icon) {
        display: none;
    }

    .kg-filter-bar {
        justify-content: center;
    }

    #kg-split-view>div {
        grid-template-columns: 1fr !important;
    }

    #kg-network-container {
        height: 350px !important;
    }
}

/* PDF Live View Styles */
.single-draft-display-container {
    background: #f3f4f6;
    border-radius: 12px;
    overflow-y: auto;
    overflow-x: auto;
    border: 1px solid var(--border-color);
    padding: 40px;
    text-align: center;
    height: 800px;
    position: relative;
    /* Dark mode override */
    transition: background 0.3s ease;
}

body.dark-theme .single-draft-display-container {
    background: #1e1e2d;
}

.document-page {
    width: 210mm;
    min-height: 297mm;
    padding: 25mm;
    background: white;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    font-family: 'Times New Roman', Georgia, serif;
    font-size: 12pt;
    line-height: 1.6;
    color: #000;
    margin: 0 auto;
    box-sizing: border-box;
    text-align: justify;
    hyphens: auto;
}

.document-page-title {
    text-align: center;
    font-weight: bold;
    font-size: 14pt;
    margin-bottom: 18pt;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pdf-toolbar {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
}

.document-preview-wrapper {
    display: inline-block;
    text-align: left;
    padding-bottom: 50px;
}

/* ============================================
   LEGAL DOCUMENT FORMATTING
   ============================================ */

/* Court Header - Top of document, centered, uppercase */
.document-page .legal-court-header {
    text-align: center;
    text-transform: uppercase;
    font-weight: bold;
    font-size: 13pt;
    margin-bottom: 12pt;
    line-height: 1.4;
}

/* Case Title / Cause Title */
.document-page .legal-cause-title {
    text-align: center;
    margin: 20pt 0;
    font-size: 12pt;
}

.document-page .legal-cause-title .party-petitioner,
.document-page .legal-cause-title .party-respondent {
    margin: 8pt 0;
}

.document-page .legal-cause-title .versus {
    text-align: center;
    font-weight: bold;
    margin: 10pt 0;
    font-style: italic;
}

/* Section Headings */
.document-page h1,
.document-page .legal-heading-1 {
    text-align: center;
    text-transform: uppercase;
    font-weight: bold;
    font-size: 14pt;
    margin: 24pt 0 12pt;
    text-decoration: underline;
}

.document-page h2,
.document-page .legal-heading-2 {
    text-align: center;
    text-transform: uppercase;
    font-weight: bold;
    font-size: 13pt;
    margin: 18pt 0 10pt;
}

.document-page h3,
.document-page .legal-heading-3 {
    font-weight: bold;
    font-size: 12pt;
    margin: 14pt 0 8pt;
    text-decoration: underline;
}

.document-page h4,
.document-page .legal-heading-4 {
    font-weight: bold;
    font-size: 12pt;
    margin: 10pt 0 6pt;
    font-style: italic;
}

/* Numbered Paragraphs - Legal style with hanging indent */
.document-page .numbered-para {
    margin: 10pt 0 10pt 36pt;
    text-indent: -36pt;
    text-align: justify;
}

.document-page .numbered-para .para-num {
    display: inline-block;
    width: 30pt;
    font-weight: bold;
}

/* Lettered Sub-paragraphs (a), (b), etc */
.document-page .lettered-para {
    margin: 8pt 0 8pt 54pt;
    text-indent: -18pt;
}

/* Prayer Section - Indented list */
.document-page .prayer-item {
    margin: 6pt 0 6pt 54pt;
    text-indent: -18pt;
}

/* Regular paragraphs */
.document-page p {
    margin: 10pt 0;
    text-align: justify;
}

/* Strong / Bold text */
.document-page strong,
.document-page b {
    font-weight: bold;
}

/* Emphasis / Italic */
.document-page em,
.document-page i {
    font-style: italic;
}

/* Underline */
.document-page u,
.document-page .underline {
    text-decoration: underline;
}

/* Tables for List of Dates, etc */
.document-page table {
    width: 100%;
    border-collapse: collapse;
    margin: 14pt 0;
    font-size: 11pt;
}

.document-page table th,
.document-page table td {
    border: 1px solid #333;
    padding: 8pt 10pt;
    text-align: left;
    vertical-align: top;
}

.document-page table th {
    background: #f5f5f5;
    font-weight: bold;
    text-align: center;
}

.document-page table thead {
    background: #f0f0f0;
}

/* Signature Block */
.document-page .signature-block {
    margin-top: 30pt;
    text-align: right;
}

.document-page .signature-block .place-date {
    text-align: left;
    float: left;
}

.document-page .signature-block .advocate-details {
    text-align: right;
}

/* Verification Section */
.document-page .verification {
    margin-top: 24pt;
    font-style: normal;
}

/* Streaming Cursor */
.document-page .streaming-cursor {
    animation: blink 1s step-start infinite;
    color: #0066cc;
    font-weight: bold;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

/* Responsive scaling for smaller screens */
@media screen and (max-width: 900px) {
    .document-page {
        width: 100%;
        min-height: auto;
        padding: 15mm;
        font-size: 11pt;
    }
}

/* Print styles */
@media print {
    .document-page {
        box-shadow: none;
        margin: 0;
        page-break-after: always;
    }

    .pdf-toolbar {
        display: none;
    }
}