﻿/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   IA Act Compliance Checker â€” Modern UI
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

/* â”€â”€ Variables & Tokens â”€â”€ */
:root {
    /* Colors */
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --success: #10b981;
    --success-light: #34d399;
    --danger: #ef4444;
    --danger-light: #f87171;
    --warning: #f59e0b;
    --warning-light: #fbbf24;

    /* Dark theme (default) */
    --bg-body: #0a0a1a;
    --bg-card: rgba(17, 17, 34, 0.8);
    --bg-card-hover: rgba(25, 25, 50, 0.9);
    --bg-surface: rgba(30, 30, 60, 0.6);
    --bg-input: rgba(20, 20, 45, 0.8);
    --border: rgba(99, 102, 241, 0.15);
    --border-hover: rgba(99, 102, 241, 0.3);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.4);
    --glow-primary: 0 0 30px rgba(99, 102, 241, 0.3);
    --glow-success: 0 0 30px rgba(16, 185, 129, 0.3);
    --glow-danger: 0 0 30px rgba(239, 68, 68, 0.3);

    /* Sizing */
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --max-width: 1100px;
}

[data-theme="light"] {
    --bg-body: #f0f2f5;
    --bg-card: rgba(255, 255, 255, 0.9);
    --bg-card-hover: rgba(255, 255, 255, 1);
    --bg-surface: rgba(241, 245, 249, 0.8);
    --bg-input: rgba(255, 255, 255, 0.9);
    --border: rgba(0, 0, 0, 0.08);
    --border-hover: rgba(99, 102, 241, 0.3);
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.12);
    --glow-primary: 0 0 20px rgba(99, 102, 241, 0.15);
    --glow-success: 0 0 20px rgba(16, 185, 129, 0.15);
    --glow-danger: 0 0 20px rgba(239, 68, 68, 0.15);
}


/* â”€â”€ Reset & Base â”€â”€ */
*, *::before, *::after {
    margin: 0; padding: 0; box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background 0.4s ease, color 0.3s ease;
}


/* â”€â”€ Particles Background â”€â”€ */
.particles {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: var(--primary-light);
    border-radius: 50%;
    opacity: 0;
    animation: floatParticle linear infinite;
}

@keyframes floatParticle {
    0% { transform: translateY(100vh) scale(0); opacity: 0; }
    10% { opacity: 0.6; }
    90% { opacity: 0.6; }
    100% { transform: translateY(-10vh) scale(1); opacity: 0; }
}


/* â”€â”€ Navbar â”€â”€ */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    transition: all 0.3s ease;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.nav-brand:hover {
    opacity: 0.8;
}

.brand-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: var(--glow-primary);
}

.brand-title {
    font-size: 18px;
    font-weight: 700;
    display: block;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-subtitle {
    font-size: 11px;
    color: var(--text-muted);
    display: block;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-stats {
    display: flex;
    gap: 8px;
}

.stat-pill {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    background: var(--bg-surface);
    border-radius: 20px;
    font-size: 12px;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-icon {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: var(--bg-surface);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

/* â”€â”€ Language Toggle â”€â”€ */
.lang-toggle {
    width: auto;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.lang-toggle:hover {
    background: var(--bg-surface);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.lang-toggle.lang-en {
    color: var(--primary-light);
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.lang-toggle .lang-label {
    pointer-events: none;
}


/* â”€â”€ Icons â”€â”€ */
.icon { width: 20px; height: 20px; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 28px; height: 28px; }
.icon-xl { width: 48px; height: 48px; }


/* â”€â”€ Main Container â”€â”€ */
.main-container {
    position: relative;
    z-index: 1;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px 60px;
}

.section {
    margin-top: 32px;
    animation: fadeInUp 0.6s ease both;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}


/* â”€â”€ Hero â”€â”€ */
.hero {
    text-align: center;
    padding: 60px 0 20px;
}

.hero-badge {
    display: inline-block;
    padding: 6px 16px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.15));
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-light);
    margin-bottom: 16px;
    animation: fadeInUp 0.6s ease 0.1s both;
}

.hero-title {
    font-size: clamp(28px, 5vw, 48px);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 16px;
    animation: fadeInUp 0.6s ease 0.2s both;
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary-light), #a78bfa, #f472b6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 200% auto;
    animation: gradientShift 4s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% center; }
    50% { background-position: 100% center; }
}

.hero-desc {
    font-size: 16px;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    animation: fadeInUp 0.6s ease 0.3s both;
}


/* â”€â”€ Cards â”€â”€ */
.card {
    border-radius: var(--radius-lg);
    padding: 28px;
    transition: all 0.3s ease;
}

.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.glass-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-lg);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    color: var(--text-primary);
}

.card-header h2 {
    font-size: 20px;
    font-weight: 700;
}

.card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}


/* â”€â”€ Form â”€â”€ */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.input-wrapper {
    position: relative;
}

.form-input {
    width: 100%;
    padding: 10px 40px 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    font-family: 'JetBrains Mono', monospace;
    transition: all 0.2s ease;
    outline: none;
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.input-icon {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
}


/* â”€â”€ Dropzone â”€â”€ */
.dropzone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    margin-bottom: 20px;
}

.dropzone::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.dropzone:hover, .dropzone.drag-over {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.dropzone:hover::before, .dropzone.drag-over::before {
    opacity: 1;
}

.dropzone-content {
    position: relative;
    z-index: 1;
}

.dropzone-icon {
    margin-bottom: 16px;
    color: var(--primary-light);
    animation: bounceGentle 2s ease-in-out infinite;
}

@keyframes bounceGentle {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.dropzone-text {
    font-size: 15px;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.dropzone-hint {
    font-size: 13px;
    color: var(--text-muted);
}

.dropzone-formats {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-top: 16px;
}

.format-tag {
    padding: 2px 10px;
    background: var(--bg-surface);
    border-radius: 4px;
    font-size: 11px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-muted);
    border: 1px solid var(--border);
}


/* â”€â”€ File Info â”€â”€ */
.file-info {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 18px;
    margin-bottom: 20px;
    animation: fadeInUp 0.3s ease;
}

.file-info-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.file-icon-wrapper {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: var(--radius-sm);
    color: white;
    flex-shrink: 0;
}

.file-details {
    flex: 1;
    min-width: 0;
}

.file-name {
    display: block;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-size {
    font-size: 12px;
    color: var(--text-muted);
}

.btn-danger-ghost {
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.2);
}

.btn-danger-ghost:hover {
    background: rgba(239, 68, 68, 0.1);
}

.file-preview-wrapper {
    margin-top: 12px;
}

.file-preview {
    margin-top: 8px;
    padding: 12px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--text-secondary);
    max-height: 200px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
    border: 1px solid var(--border);
}


/* â”€â”€ Buttons â”€â”€ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
    border-radius: var(--radius);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: var(--glow-primary);
    width: 100%;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 0 40px rgba(99, 102, 241, 0.4);
}

.btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-glow {
    animation: pulseGlow 2s ease infinite;
}

.btn-primary:disabled .btn-glow,
.btn-primary:disabled {
    animation: none;
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 20px rgba(99, 102, 241, 0.3); }
    50% { box-shadow: 0 0 40px rgba(99, 102, 241, 0.5); }
}

.btn-shine {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.btn:hover .btn-shine { transform: translateX(100%); }

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: var(--bg-surface);
    border-color: var(--border-hover);
}

.btn-ghost {
    background: transparent;
    border: none;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    color: var(--text-primary);
    background: var(--bg-surface);
}


/* â”€â”€ Progress Section â”€â”€ */
.progress-container {
    margin-bottom: 24px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 13px;
}

#progressText {
    color: var(--text-secondary);
    max-width: 70%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#progressPct {
    font-weight: 700;
    color: var(--primary-light);
    font-family: 'JetBrains Mono', monospace;
}

.progress-bar {
    height: 8px;
    background: var(--bg-surface);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light), #a78bfa);
    background-size: 200% auto;
    border-radius: 4px;
    transition: width 0.5s ease;
    animation: shimmer 2s linear infinite;
}

@keyframes shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

.progress-glow {
    position: absolute;
    top: -2px;
    right: 0;
    width: 60px;
    height: 12px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.6), transparent);
    border-radius: 50%;
    filter: blur(4px);
    animation: glowMove 2s ease infinite;
}

.progress-steps {
    text-align: center;
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.progress-detail {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 10px;
    padding: 8px 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 12px;
}

.progress-cp-name {
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.progress-eta {
    color: var(--primary);
    font-weight: 600;
    white-space: nowrap;
    font-size: 12px;
}

/* â”€â”€ Sticky Eval Topbar â”€â”€ */
.eval-topbar {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    z-index: 99;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 12px var(--shadow);
    backdrop-filter: blur(20px);
    animation: slideDown .3s ease;
}
@keyframes slideDown { from { transform: translateY(-100%); } to { transform: translateY(0); } }

.eval-topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 24px;
    gap: 16px;
}
.eval-topbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}
.eval-topbar-cp {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    background: rgba(99, 102, 241, .12);
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
}
.eval-topbar-text {
    font-size: 12px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}
.eval-topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
}
.eval-topbar-steps {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}
.eval-topbar-pct {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
    min-width: 36px;
    text-align: right;
}
.eval-topbar-eta {
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg-surface);
    padding: 2px 8px;
    border-radius: 4px;
}
.eval-topbar-track {
    height: 3px;
    background: var(--bg-surface);
}
.eval-topbar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #a78bfa);
    border-radius: 0 3px 3px 0;
    transition: width .4s ease;
}

.progress-animation {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    height: 120px;
}

.pulse-ring {
    position: absolute;
    width: 80px;
    height: 80px;
    border: 2px solid var(--primary);
    border-radius: 50%;
    animation: pulseRing 2s ease-out infinite;
}

.delay-1 { animation-delay: 0.5s; }
.delay-2 { animation-delay: 1s; }

@keyframes pulseRing {
    0% { transform: scale(0.5); opacity: 0.8; }
    100% { transform: scale(2); opacity: 0; }
}

.progress-brain {
    color: var(--primary-light);
    z-index: 1;
    animation: rotateBrain 3s ease-in-out infinite;
}

@keyframes rotateBrain {
    0%, 100% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(5deg) scale(1.05); }
    75% { transform: rotate(-5deg) scale(1.05); }
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}


/* â”€â”€ Error Section â”€â”€ */
.card-error {
    border-color: rgba(239, 68, 68, 0.3);
}

.text-danger { color: var(--danger); }

.error-message {
    color: var(--text-secondary);
    margin-bottom: 16px;
    font-size: 14px;
    padding: 12px;
    background: rgba(239, 68, 68, 0.05);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(239, 68, 68, 0.15);
}


/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   RESULTS
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

.results-header {
    display: flex;
    align-items: center;
    gap: 32px;
    padding: 32px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-lg);
    animation: fadeInUp 0.6s ease both;
}

/* Score Ring */
.score-ring-container {
    position: relative;
    width: 160px;
    height: 160px;
    flex-shrink: 0;
    cursor: help;
}

/* ── Tooltip de raisonnement du score (déterministe) ── */
.score-tooltip {
    position: absolute;
    top: 50%;
    left: calc(100% + 16px);
    transform: translateY(-50%) translateX(-8px);
    width: 360px;
    max-width: 90vw;
    padding: 14px 16px;
    background: rgba(15, 23, 42, 0.97);
    color: #e2e8f0;
    border: 1px solid rgba(99, 102, 241, 0.35);
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
    font-size: 0.78rem;
    line-height: 1.55;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 1000;
    backdrop-filter: blur(8px);
}
.score-tooltip::before {
    content: "";
    position: absolute;
    top: 50%;
    right: 100%;
    transform: translateY(-50%);
    border: 7px solid transparent;
    border-right-color: rgba(15, 23, 42, 0.97);
}
.score-ring-container:hover .score-tooltip,
.score-ring-container:focus-within .score-tooltip {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
    pointer-events: auto;
}
.score-tooltip h4 {
    margin: 0 0 8px 0;
    font-size: 0.85rem;
    color: #818cf8;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.score-tooltip .stt-formula {
    background: rgba(99, 102, 241, 0.12);
    padding: 6px 8px;
    border-radius: 6px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.72rem;
    margin: 6px 0 10px;
    color: #c7d2fe;
}
.score-tooltip ul {
    list-style: none;
    padding: 0;
    margin: 6px 0;
}
.score-tooltip li {
    display: flex;
    justify-content: space-between;
    padding: 2px 0;
    border-bottom: 1px dashed rgba(148, 163, 184, 0.15);
}
.score-tooltip li:last-child { border-bottom: none; }
.score-tooltip .stt-key { color: #94a3b8; }
.score-tooltip .stt-val { color: #f1f5f9; font-weight: 600; font-variant-numeric: tabular-nums; }
.score-tooltip .stt-section {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(99, 102, 241, 0.25);
}
.score-tooltip .stt-veto {
    margin-top: 8px;
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 0.74rem;
}
.score-tooltip .stt-veto.veto-actif {
    background: rgba(239, 68, 68, 0.18);
    color: #fecaca;
    border-left: 3px solid #ef4444;
}
.score-tooltip .stt-veto.veto-inactif {
    background: rgba(16, 185, 129, 0.12);
    color: #a7f3d0;
    border-left: 3px solid #10b981;
}
.score-tooltip .stt-foot {
    margin-top: 10px;
    font-size: 0.7rem;
    color: #94a3b8;
    font-style: italic;
}

@media (max-width: 768px) {
    .score-tooltip {
        left: 50%;
        top: calc(100% + 12px);
        transform: translate(-50%, -8px);
        width: 300px;
    }
    .score-tooltip::before {
        top: -7px;
        right: auto;
        left: 50%;
        transform: translateX(-50%);
        border: 7px solid transparent;
        border-bottom-color: rgba(15, 23, 42, 0.97);
        border-right-color: transparent;
    }
    .score-ring-container:hover .score-tooltip {
        transform: translate(-50%, 0);
    }
}

.score-ring {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.score-ring-bg {
    fill: none;
    stroke: var(--bg-surface);
    stroke-width: 12;
}

.score-ring-fill {
    fill: none;
    stroke: var(--primary);
    stroke-width: 12;
    stroke-linecap: round;
    stroke-dasharray: 534;
    stroke-dashoffset: 534;
    transition: stroke-dashoffset 2s ease, stroke 0.5s ease;
}

.score-ring-text {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.score-value {
    font-size: 42px;
    font-weight: 800;
    line-height: 1;
    color: var(--primary-light);
    font-family: 'JetBrains Mono', monospace;
}

.score-label {
    font-size: 14px;
    color: var(--text-muted);
}

.results-summary {
    flex: 1;
}

.verdict-badge {
    display: inline-block;
    padding: 8px 22px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-bottom: 8px;
}

.verdict-conforme {
    background: #d1fae5;
    color: #065f46;
    border: 2px solid #34d399;
}

.verdict-non_conforme {
    background: #fee2e2;
    color: #991b1b;
    border: 2px solid #f87171;
}

.verdict-ambigu {
    background: #fef3c7;
    color: #92400e;
    border: 2px solid #fbbf24;
}

.verdict-non_applicable {
    background: #f1f5f9;
    color: #475569;
    border: 2px solid #94a3b8;
}

.results-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.results-file {
    color: var(--text-muted);
    font-size: 13px;
}


/* â”€â”€ KPI Grid â”€â”€ */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 24px;
}

.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    backdrop-filter: blur(20px);
    transition: all 0.3s ease;
    animation: fadeInUp 0.4s ease both;
}

.kpi-card:nth-child(1) { animation-delay: 0.1s; }
.kpi-card:nth-child(2) { animation-delay: 0.2s; }
.kpi-card:nth-child(3) { animation-delay: 0.3s; }
.kpi-card:nth-child(4) { animation-delay: 0.4s; }

.kpi-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.kpi-conformes:hover { border-color: var(--success); box-shadow: var(--glow-success); }
.kpi-non-conformes:hover { border-color: var(--danger); box-shadow: var(--glow-danger); }
.kpi-ambigus:hover { border-color: var(--warning); }
.kpi-taux:hover { border-color: var(--primary); box-shadow: var(--glow-primary); }

.kpi-icon {
    margin-bottom: 8px;
}

.kpi-conformes .kpi-icon { color: var(--success); }
.kpi-non-conformes .kpi-icon { color: var(--danger); }
.kpi-ambigus .kpi-icon { color: var(--warning); }
.kpi-taux .kpi-icon { color: var(--primary-light); }

.kpi-value {
    font-size: 32px;
    font-weight: 800;
    font-family: 'JetBrains Mono', monospace;
    line-height: 1.2;
}

.kpi-conformes .kpi-value { color: var(--success); }
.kpi-non-conformes .kpi-value { color: var(--danger); }
.kpi-ambigus .kpi-value { color: var(--warning); }
.kpi-taux .kpi-value { color: var(--primary-light); }

.kpi-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}


/* â”€â”€ Charts â”€â”€ */
.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 24px;
}

.chart-container {
    position: relative;
    height: 280px;
}

/* Doughnut "Répartition des verdicts" — cercle parfait */
.chart-container-pie {
    display: flex;
    align-items: center;
    justify-content: center;
}
.chart-container-pie > canvas {
    max-width: 240px !important;
    max-height: 240px !important;
    aspect-ratio: 1 / 1;
}

/* Légende inline sous le doughnut : une seule ligne, pastilles rondes */
.chart-legend-inline {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    gap: 14px;
    margin-top: 14px;
    padding: 0 8px;
    overflow-x: auto;
}
.chart-legend-inline .legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Inter', sans-serif;
    font-size: 11.5px;
    color: var(--text-secondary);
    white-space: nowrap;
    flex-shrink: 0;
}
.chart-legend-inline .legend-dot {
    width: 10px;
    height: 10px;
    min-width: 10px;
    min-height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
.chart-legend-inline .legend-value {
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
}

.chart-bar-container {
    height: 280px;
    overflow-y: auto;
    overflow-x: hidden;
}

.chart-bar-inner {
    position: relative;
    min-height: 100%;
}

/* â”€â”€ Multi-regulation result tabs â”€â”€ */
.reg-result-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    padding: 6px;
    background: var(--bg-secondary, rgba(255,255,255,0.03));
    border-radius: 12px;
    border: 1px solid var(--border, rgba(255,255,255,0.08));
    overflow-x: auto;
    flex-wrap: wrap;
}

.reg-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary, #aaa);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.reg-tab:hover {
    background: rgba(99, 102, 241, 0.08);
    color: var(--text-primary, #fff);
}

.reg-tab.active {
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--primary, #6366f1);
    color: var(--text-primary, #fff);
    font-weight: 600;
}

.spinner-tiny {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(99, 102, 241, 0.2);
    border-top-color: var(--primary, #6366f1);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}


/* â”€â”€ Detail Section â”€â”€ */
.detail-section {
    margin-top: 32px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-primary);
}

/* Category Accordion */
.category-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    animation: fadeInUp 0.4s ease both;
}

.category-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
    cursor: pointer;
    transition: background 0.2s ease;
    user-select: none;
    flex-wrap: wrap;
}

.category-header:hover {
    background: var(--bg-surface);
}

.category-verdict-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.verdict-icon-conforme { background: #d1fae5; color: #065f46; }
.verdict-icon-non_conforme { background: #fee2e2; color: #991b1b; }
.verdict-icon-ambigu { background: #fef3c7; color: #92400e; }
.verdict-icon-non_applicable { background: #f1f5f9; color: #475569; }

.category-info {
    flex: 1 1 240px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.category-name {
    font-weight: 600;
    font-size: 14px;
    line-height: 1.35;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    hyphens: auto;
}

.category-article {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.35;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.category-score {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-left: auto;
}

.category-score-value {
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    white-space: nowrap;
}

.category-score-bar {
    width: 60px;
    height: 6px;
    background: var(--bg-surface);
    border-radius: 3px;
    overflow: hidden;
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .category-score-bar { width: 40px; }
    .category-score { width: 100%; justify-content: flex-end; }
}

.category-score-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 1s ease;
}

.category-chevron {
    transition: transform 0.3s ease;
    color: var(--text-muted);
}

.category-card.open .category-chevron {
    transform: rotate(180deg);
}

.category-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-in-out;
}

.category-card.open .category-body {
    max-height: 50000px;
    overflow: visible;
    transition: max-height 0.8s ease-in-out;
}

.category-body-inner {
    padding: 0 20px 20px;
}

/* Obligation */
.obligation-card {
    margin-top: 12px;
    padding: 14px 16px;
    background: var(--bg-surface);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--border);
    overflow: visible;
}

.obligation-card.verdict-conforme-border { border-left-color: #059669; }
.obligation-card.verdict-non_conforme-border { border-left-color: #dc2626; }
.obligation-card.verdict-ambigu-border { border-left-color: #d97706; }

.obligation-header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 8px;
    margin-bottom: 8px;
}

.obligation-id {
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
}

.obligation-desc {
    font-size: 12px;
    color: var(--text-secondary);
    flex: 1 1 200px;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.4;
}

.obligation-meta {
    display: flex;
    gap: 12px;
    margin-bottom: 10px;
    font-size: 11px;
    color: var(--text-muted);
}

/* Checkpoint */
.checkpoint-item {
    padding: 12px 14px;
    margin-top: 8px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    transition: all 0.2s ease;
    overflow: visible;
}

.checkpoint-item:hover {
    border-color: var(--border-hover);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.checkpoint-header {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.checkpoint-verdict-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 6px;
    flex-shrink: 0;
}

.dot-conforme { background: #059669; box-shadow: 0 0 8px rgba(5, 150, 105, 0.5); width: 10px; height: 10px; }
.dot-non_conforme { background: #dc2626; box-shadow: 0 0 8px rgba(220, 38, 38, 0.5); width: 10px; height: 10px; }
.dot-ambigu { background: #d97706; box-shadow: 0 0 8px rgba(217, 119, 6, 0.5); width: 10px; height: 10px; }
.dot-non_applicable { background: #94a3b8; box-shadow: 0 0 8px rgba(148, 163, 184, 0.5); width: 10px; height: 10px; }

.checkpoint-question {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
}

.checkpoint-score-pill {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 800;
    font-family: 'JetBrains Mono', monospace;
    flex-shrink: 0;
}

.pill-conforme { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; font-size: 12px; }
.pill-non_conforme { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; font-size: 12px; }
.pill-ambigu { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; font-size: 12px; }
.pill-non_applicable { background: #e0e7ff; color: #3730a3; border: 1px dashed #6366f1; font-size: 12px; font-style: italic; font-weight: 600; letter-spacing: 0.3px; }

.checkpoint-justification {
    margin-top: 6px;
    padding-left: 16px;
    font-size: 12px;
    color: var(--text-secondary);
    font-style: italic;
}

.checkpoint-detail-toggle {
    margin-top: 6px;
    padding-left: 16px;
}

.checkpoint-detail-content {
    margin-top: 6px;
    padding: 10px;
    background: var(--bg-surface);
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--text-secondary);
    display: none;
}

.checkpoint-detail-content.open {
    display: block;
    animation: fadeInUp 0.3s ease;
}

.elements-list {
    margin-top: 6px;
    padding-left: 16px;
}

.elements-list li {
    font-size: 12px;
    margin-bottom: 2px;
    list-style: none;
}

.elements-list li::before {
    margin-right: 4px;
}

.elements-trouves li::before { content: "✅"; }
.elements-manquants li::before { content: "❌"; }

.checkpoint-recommandation {
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(99, 102, 241, 0.08);
    border-left: 3px solid var(--primary);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 12px;
    color: var(--text-secondary);
}


/* â”€â”€ Downloads â”€â”€ */
.download-section {
    margin-top: 32px;
}

.download-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.btn-download {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 16px;
    border-radius: var(--radius);
    font-size: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-download:hover {
    background: var(--bg-surface);
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: var(--glow-primary);
}

.btn-view-report {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.btn-view-report:hover {
    filter: brightness(1.15);
    color: #fff;
}

.new-eval-section {
    text-align: center;
    margin-top: 32px;
}


/* â”€â”€ Info Cards â”€â”€ */
.info-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.info-card {
    text-align: center;
    padding: 24px 16px;
    animation: fadeInUp 0.4s ease var(--delay) both;
    cursor: default;
}

.info-card:hover {
    transform: translateY(-4px);
}

.info-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.1));
    border-radius: var(--radius);
    color: var(--primary-light);
}

.info-card h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
}

.info-card p {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Coverage */
.coverage-card {
    margin-top: 20px;
}

.clickable {
    cursor: pointer;
}

.toggle-icon {
    margin-left: auto;
    transition: transform 0.3s ease;
}

.toggle-icon.open {
    transform: rotate(180deg);
}

.coverage-content {
    animation: fadeInUp 0.3s ease;
}

.coverage-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s ease;
}

.coverage-item:last-child { border-bottom: none; }
.coverage-item:hover { background: var(--bg-surface); }

.coverage-article {
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--primary-light);
    min-width: 60px;
}

.coverage-name {
    flex: 1;
    font-size: 13px;
}

.coverage-badges {
    display: flex;
    gap: 6px;
}


/* â”€â”€ Badges â”€â”€ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.badge-muted {
    background: var(--bg-surface);
    color: var(--text-muted);
    border: 1px solid var(--border);
}


/* â”€â”€ Footer â”€â”€ */
.footer {
    text-align: center;
    padding: 24px;
    font-size: 12px;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
}


/* â”€â”€ Toast Notifications â”€â”€ */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-lg);
    animation: slideInRight 0.3s ease;
    min-width: 280px;
    font-size: 13px;
}

.toast-success { border-left: 3px solid var(--success); }
.toast-error { border-left: 3px solid var(--danger); }
.toast-info { border-left: 3px solid var(--primary); }

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}


/* â”€â”€ Responsive â”€â”€ */
@media (max-width: 768px) {
    .nav-stats { display: none; }
    .results-header { flex-direction: column; text-align: center; }
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .charts-grid { grid-template-columns: 1fr; }
    .info-grid { grid-template-columns: repeat(2, 1fr); }
    .download-grid { grid-template-columns: 1fr; }
    .hero-title { font-size: 28px; }
}

@media (max-width: 480px) {
    .info-grid { grid-template-columns: 1fr; }
    .kpi-grid { grid-template-columns: 1fr 1fr; }
}


/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
/* CHATBOT WIDGET                        */
/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

.chatbot-fab {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 900;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(99, 102, 241, .4);
    transition: transform .2s, box-shadow .2s;
    border: none;
}
.chatbot-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 28px rgba(99, 102, 241, .55);
}

.chatbot-panel {
    position: fixed;
    bottom: 96px;
    right: 28px;
    z-index: 901;
    width: 400px;
    max-height: 600px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(20px);
    animation: chatbotSlideUp .3s ease;
}
@keyframes chatbotSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.chatbot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, rgba(99,102,241,.08), rgba(139,92,246,.05));
    border-radius: var(--radius) var(--radius) 0 0;
}
.chatbot-header-info { display: flex; flex-direction: column; gap: 2px; }
.chatbot-title { font-weight: 700; font-size: 14px; }
.chatbot-mode-label { font-size: 11px; color: var(--text-muted); }

.chatbot-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
}
.chatbot-close:hover { color: var(--danger); }

/* Mode selector */
.chatbot-modes {
    display: flex;
    gap: 4px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-surface);
}
.chatbot-mode-btn {
    flex: 1;
    padding: 6px 8px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all .2s;
    text-align: center;
}
.chatbot-mode-btn:hover {
    background: rgba(99,102,241,.08);
    border-color: var(--primary);
}
.chatbot-mode-btn.active {
    background: rgba(99,102,241,.15);
    border-color: var(--primary);
    color: var(--primary-light);
}

/* Rapport bar */
.chatbot-rapport-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    font-size: 11px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    background: rgba(245,158,11,.04);
}
.chatbot-rapport-status { flex: 1; }
.chatbot-rapport-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 3px 8px;
    font-size: 11px;
    cursor: pointer;
    color: var(--primary-light);
    transition: all .2s;
}
.chatbot-rapport-btn:hover {
    background: rgba(99,102,241,.1);
    border-color: var(--primary);
}

/* Messages */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 350px;
    min-height: 200px;
}
.chatbot-msg {
    max-width: 88%;
    animation: chatbotMsg .25s ease;
}
@keyframes chatbotMsg {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.chatbot-msg-content {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.55;
    word-break: break-word;
}
.chatbot-msg-bot { align-self: flex-start; }
.chatbot-msg-bot .chatbot-msg-content {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
    color: var(--text-primary);
}
.chatbot-msg-user { align-self: flex-end; }
.chatbot-msg-user .chatbot-msg-content {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    border-bottom-right-radius: 4px;
}

/* Barre de confirmation Oui/Non (clarification) */
.chatbot-confirm-bar .chatbot-msg-content {
    background: transparent;
    border: none;
    padding: 4px 0;
}
.chatbot-confirm-actions {
    display: flex;
    gap: 8px;
}
.chatbot-confirm-actions .btn {
    min-width: 72px;
}

/* Flash de feedback quand un checkpoint est mis à jour par la clarification */
@keyframes checkpointUpdatedFlash {
    0%   { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55); background-color: rgba(34, 197, 94, 0.12); }
    70%  { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); background-color: rgba(34, 197, 94, 0.05); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); background-color: transparent; }
}
.checkpoint-updated-flash {
    animation: checkpointUpdatedFlash 1.8s ease-out;
    border-radius: 8px;
}

.chatbot-typing {
    display: inline-flex;
    gap: 4px;
    padding: 10px 16px;
}
.chatbot-typing span {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: chatbotDot 1.2s infinite;
}
.chatbot-typing span:nth-child(2) { animation-delay: .2s; }
.chatbot-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes chatbotDot {
    0%, 80%, 100% { opacity: .3; transform: scale(.8); }
    40% { opacity: 1; transform: scale(1.1); }
}

/* Input */
.chatbot-input-area {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--border);
    background: var(--bg-surface);
    border-radius: 0 0 var(--radius) var(--radius);
}
.chatbot-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    transition: border-color .2s;
}
.chatbot-input:focus { border-color: var(--primary); }
.chatbot-input::placeholder { color: var(--text-muted); }

.chatbot-send {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--primary);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s, transform .15s;
}
.chatbot-send:hover { background: var(--primary-light); transform: scale(1.05); }
.chatbot-send:disabled { opacity: .5; cursor: default; transform: none; }

@media (max-width: 480px) {
    .chatbot-panel { width: calc(100vw - 24px); right: 12px; bottom: 80px; }
    .chatbot-fab { bottom: 16px; right: 16px; }
}


/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   TRACE D'AUDIT LLM â€” FULLSCREEN VIEWER
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

/* â•â• LAUNCH BAR â•â• */
.logs-launch-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.5rem;
    padding: 1rem 1.5rem;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}
.logs-launch-bar:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-lg);
}

.logs-launch-left {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.logs-launch-icon { font-size: 1.6rem; color: var(--primary); }

.logs-launch-text {
    display: flex;
    flex-direction: column;
}

.logs-launch-text strong { font-size: 0.95rem; color: var(--text-primary); }

.logs-launch-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
}

.logs-launch-buttons {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.btn-logs-download {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1rem;
    background: var(--bg-surface);
    color: var(--primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-logs-download:hover { background: var(--bg-card-hover); border-color: var(--primary); }

.btn-logs-open {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1rem;
    background: var(--primary);
    color: white;
    border: 1px solid var(--primary);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-logs-open:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--glow-primary);
}

/* â•â• OVERLAY â•â• */
.logs-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* â•â• FULLSCREEN CONTAINER â•â• */
.logs-fullscreen {
    width: 100vw;
    height: 100vh;
    background: var(--bg-body);
    display: flex;
    flex-direction: column;
    animation: slideUp 0.25s ease;
    overflow: hidden;
    min-height: 0;
}

@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* â”€â”€ FS HEADER â”€â”€ */
.logs-fs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.7rem 1.5rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    flex-shrink: 0;
}

.logs-fs-title {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.logs-fs-icon { font-size: 1.4rem; color: var(--primary); }
.logs-fs-title h2 { margin: 0; font-size: 1.15rem; font-weight: 700; color: var(--text-primary); }

.logs-fs-badge {
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid var(--primary);
    color: var(--text-primary);
    padding: 0.25rem 0.7rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}
.logs-fs-badge.faible { background: rgba(239, 68, 68, 0.15); border-color: var(--danger); }
.logs-fs-badge.moyenne { background: rgba(245, 158, 11, 0.15); border-color: var(--warning); }

.logs-fs-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.logs-fs-stats {
    display: flex;
    gap: 0.4rem;
    margin-right: 0.5rem;
}

.fs-stat {
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: 16px;
    background: var(--bg-surface);
}
.fs-stat-haute { color: var(--success); }
.fs-stat-moyenne { color: var(--warning); }
.fs-stat-faible { color: var(--danger); }
.fs-stat-total { color: var(--text-muted); }

.btn-fs {
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.btn-fs:hover { background: var(--bg-card-hover); border-color: var(--primary); }
.btn-fs-close:hover { background: rgba(239, 68, 68, 0.2); border-color: var(--danger); }

/* â”€â”€ FS TOOLBAR â”€â”€ */
.logs-fs-toolbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.6rem 1.5rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.logs-filters {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.3rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-size: 0.76rem;
    cursor: pointer;
    transition: all 0.2s;
}
.filter-btn:hover { border-color: var(--primary); color: var(--primary); }
.filter-btn.active { background: var(--primary); color: white; border-color: var(--primary); }

.logs-fs-search {
    margin-left: auto;
}
.logs-fs-search input {
    width: 240px;
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.8rem;
    outline: none;
    background: var(--bg-input);
    color: var(--text-primary);
    transition: border-color 0.2s;
}
.logs-fs-search input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15); }

/* â”€â”€ FS BODY (scrollable) â”€â”€ */
.logs-fs-body {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem 1.5rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.logs-fs-body::-webkit-scrollbar { width: 8px; }
.logs-fs-body::-webkit-scrollbar-track { background: transparent; }
.logs-fs-body::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 4px; }
.logs-fs-body::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   LOG ITEMS
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

.log-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: visible;
    transition: box-shadow 0.2s;
    flex-shrink: 0;
}

.log-item:hover { box-shadow: var(--shadow); }
.log-item.verdict-conforme { border-left: 5px solid var(--success); }
.log-item.verdict-non_conforme { border-left: 5px solid var(--danger); }
.log-item.verdict-ambigu { border-left: 5px solid var(--warning); }

/* â”€â”€ Header â”€â”€ */
.log-header {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
    gap: 0.7rem;
}
.log-header:hover { background: var(--bg-surface); }
.log-header.expanded { background: var(--bg-surface); }

.log-vi { font-size: 1.1rem; flex-shrink: 0; }

.log-id-col {
    display: flex;
    flex-direction: column;
    gap: 1px;
    flex-shrink: 0;
}

.log-cpid {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    font-weight: 700;
    background: var(--bg-surface);
    padding: 0.1rem 0.45rem;
    border-radius: 4px;
    color: var(--primary);
    white-space: nowrap;
}

.log-oblid {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.62rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.log-q {
    flex: 1;
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.3;
    min-width: 0;
    white-space: normal;
    word-break: break-word;
}

.log-badges {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

.lbadge {
    font-size: 0.73rem;
    font-weight: 700;
    padding: 0.22rem 0.6rem;
    border-radius: 20px;
    white-space: nowrap;
}
.lbadge-conforme { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.lbadge-non_conforme { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.lbadge-ambigu { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }

.lbadge-score {
    font-weight: 800;
    border: 2px solid;
    background: white;
}
.lbadge-score-high { border-color: #059669; color: #065f46; background: #ecfdf5; }
.lbadge-score-mid { border-color: #d97706; color: #92400e; background: #fffbeb; }
.lbadge-score-low { border-color: #dc2626; color: #991b1b; background: #fef2f2; }

.lbadge-conf { font-size: 0.7rem; padding: 0.18rem 0.5rem; border-radius: 16px; font-weight: 700; }
.lbadge-conf-haute { background: #d1fae5; color: #065f46; }
.lbadge-conf-moyenne { background: #fef3c7; color: #92400e; }
.lbadge-conf-faible { background: #fee2e2; color: #991b1b; }

.log-chev {
    color: var(--text-muted);
    transition: transform 0.25s;
    margin-left: 0.2rem;
}
.log-header.expanded .log-chev { transform: rotate(180deg); }

/* â”€â”€ Body â”€â”€ */
.log-body {
    display: none;
    border-top: 1px solid var(--border);
    padding: 0;
    overflow: visible;
}
.log-body.open { display: block; }

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   COLLAPSIBLE SECTIONS (.lsec)
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

.lsec {
    border-bottom: 1px solid var(--border);
}
.lsec:last-child { border-bottom: none; }

.lsec-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.2rem;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}
.lsec-head:hover { background: var(--bg-surface); }

.lsec-icon { font-size: 1.1rem; flex-shrink: 0; }

.lsec-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary);
}

.lsec-tag {
    margin-left: auto;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    padding-right: 0.3rem;
}

.lsec-chev {
    color: var(--text-muted);
    transition: transform 0.25s;
    flex-shrink: 0;
}
.lsec.open .lsec-chev { transform: rotate(90deg); }

.lsec-body {
    display: none;
    padding: 0.5rem 1.2rem 1rem;
    animation: secFadeIn 0.2s ease;
}
.lsec.open .lsec-body { display: block; }

@keyframes secFadeIn { from { opacity: 0; } to { opacity: 1; } }

/* â”€â”€ Sub-sections â”€â”€ */
.lsec-sub {
    margin-top: 0.6rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.lsec-sub-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.8rem;
    background: var(--bg-surface);
    cursor: pointer;
    user-select: none;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: background 0.15s;
}
.lsec-sub-head:hover { background: var(--bg-card-hover); }

.lsec-sub-size {
    margin-left: auto;
    font-size: 0.68rem;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

.lsec-sub-chev {
    color: var(--text-muted);
    transition: transform 0.25s;
}
.lsec-sub.open .lsec-sub-chev { transform: rotate(90deg); }

.lsec-sub-body {
    display: none;
    padding: 0.6rem;
    animation: secFadeIn 0.15s ease;
}
.lsec-sub.open .lsec-sub-body { display: block; }

.lsec-empty {
    text-align: center;
    padding: 1rem;
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.82rem;
}

.lsec-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-left: 4px solid var(--warning);
    border-radius: 8px;
    padding: 0.5rem 0.8rem;
    font-size: 0.78rem;
    color: var(--warning);
    font-weight: 500;
    margin-top: 0.5rem;
}

/* â”€â”€ Content blocks (justification, recommandation) â”€â”€ */
.lsec-block {
    margin-top: 0.6rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    border-radius: 8px;
    padding: 0.7rem 1rem;
}
.lsec-block-warn {
    border-color: var(--border);
    border-left-color: var(--warning);
}
.lsec-block-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.3rem;
}
.lsec-block-warn .lsec-block-label { color: var(--warning); }
.lsec-block-text {
    font-size: 0.84rem;
    color: var(--text-secondary);
    line-height: 1.65;
    white-space: pre-wrap;
    word-break: break-word;
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   JSON VIEWER
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

.json-viewer {
    background: #1e1e2e;
    border-radius: 10px;
    padding: 0.8rem 1rem;
    font-family: 'Courier New', Consolas, 'Fira Code', monospace;
    font-size: 0.8rem;
    line-height: 1.7;
    border: 1px solid #313244;
    overflow-x: auto;
}

.jkv {
    display: flex;
    gap: 0.5rem;
    padding: 0.12rem 0;
}

.jk {
    color: #89b4fa;
    flex-shrink: 0;
}

.jsep {
    color: #6c7086;
}

.jv {
    color: #a6e3a1;
    word-break: break-word;
}

/* Value color variants */
.jv.num       { color: #fab387; }
.jv.num-highlight { color: #f9e2af; font-weight: 700; }
.jv.val-ok    { color: #a6e3a1; }
.jv.val-err   { color: #f38ba8; }
.jv.val-warn  { color: #f9e2af; }

.json-separator {
    height: 1px;
    background: #313244;
    margin: 0.35rem 0;
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   CODE BLOCKS
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

.code-block {
    background: #1e1e2e;
    color: #cdd6f4;
    border-radius: 8px;
    padding: 0.8rem 1rem;
    font-family: 'Courier New', Consolas, monospace;
    font-size: 0.72rem;
    line-height: 1.6;
    max-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
    border: 1px solid #313244;
    margin: 0;
}

.code-block::-webkit-scrollbar { width: 6px; }
.code-block::-webkit-scrollbar-thumb { background: #585b70; border-radius: 3px; }

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   RAG CARDS
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

.rag-cards-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.6rem;
}

.rag-card {
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    background: white;
    transition: box-shadow 0.2s;
}
.rag-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.07); }
.rag-card.rag-high { border-left: 4px solid #2e7d32; }
.rag-card.rag-mid { border-left: 4px solid #e65100; }
.rag-card.rag-low { border-left: 4px solid #c62828; }

.rag-card-top {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.8rem;
    background: #f8f9fc;
    border-bottom: 1px solid #eee;
    flex-wrap: wrap;
}

.rag-rank {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: #1565c0;
    color: white;
    border-radius: 50%;
    font-size: 0.68rem;
    font-weight: 800;
    flex-shrink: 0;
}

.rag-source {
    font-weight: 700;
    font-size: 0.82rem;
    color: #1565c0;
}

.rag-type {
    font-size: 0.65rem;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    background: #e8eaf6;
    color: #3949ab;
    font-weight: 700;
    text-transform: uppercase;
}

.rag-rel {
    font-size: 0.7rem;
    color: #888;
    font-style: italic;
}

.rag-score-bar {
    margin-left: auto;
    width: 80px;
    height: 7px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.rag-score-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}
.rag-fill-high { background: linear-gradient(90deg, #43a047, #2e7d32); }
.rag-fill-mid { background: linear-gradient(90deg, #fb8c00, #e65100); }
.rag-fill-low { background: linear-gradient(90deg, #e53935, #c62828); }

.rag-score-num {
    font-size: 0.75rem;
    font-weight: 800;
    min-width: 32px;
    text-align: right;
    font-family: 'Courier New', monospace;
}
.rag-num-high { color: #2e7d32; }
.rag-num-mid { color: #e65100; }
.rag-num-low { color: #c62828; }

.rag-card-ext {
    padding: 0.5rem 0.8rem;
    font-size: 0.78rem;
    color: #555;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   PREUVES & ELEMENTS
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

.preuves-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.preuve-card {
    background: #f6fdf7;
    border: 1px solid #c8e6c9;
    border-left: 4px solid #2e7d32;
    border-radius: 8px;
    overflow: hidden;
}

.preuve-top {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.8rem;
    background: #e8f5e9;
    border-bottom: 1px solid #c8e6c9;
}

.preuve-n {
    font-size: 0.7rem;
    font-weight: 700;
    color: #2e7d32;
    text-transform: uppercase;
}

.preuve-loc {
    display: inline-block;
    background: #1565c0;
    color: white;
    padding: 0.08rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.72rem;
    font-weight: 700;
}

.preuve-txt {
    display: block;
    padding: 0.6rem 0.9rem;
    font-size: 0.82rem;
    font-style: italic;
    line-height: 1.7;
    color: #333;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Elements grid */
.elems-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    margin-top: 0.6rem;
}

.elems-col {
    border-radius: 8px;
    padding: 0.7rem;
    border: 1px solid #e8e8e8;
}
.elems-found { background: #f6fdf7; border-color: #c8e6c9; }
.elems-missing { background: #fef6f7; border-color: #f8bbd0; }

.elems-title {
    font-size: 0.74rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    color: #555;
}

.elems-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.etag {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.73rem;
}
.etag-ok { background: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9; }
.etag-miss { background: #fce4ec; color: #c62828; border: 1px solid #f8bbd0; }

.text-muted { color: #aaa; font-size: 0.78rem; }

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   LOADING / EMPTY / ERROR
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

.logs-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.logs-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.logs-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    text-align: center;
    padding: 3rem 2rem;
    max-width: 480px;
    margin: auto;
    color: var(--text-muted);
}

.logs-empty-icon { font-size: 3rem; }
.logs-empty-state h3 { margin: 0; font-size: 1.2rem; color: var(--text-primary); }
.logs-empty-state p { margin: 0; font-size: 0.88rem; color: var(--text-muted); line-height: 1.6; }

.btn-action {
    padding: 0.55rem 1.2rem;
    background: var(--primary, #1565c0);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-action:hover { background: #0d47a1; }

/* Per-obligation "Voir les logs" button */
.btn-voir-logs-obligation {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.65rem;
    background: var(--bg-surface);
    color: var(--primary);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-voir-logs-obligation:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   RESPONSIVE
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

@media (max-width: 768px) {
    .logs-fs-header { flex-direction: column; gap: 0.5rem; align-items: flex-start; }
    .logs-fs-actions { width: 100%; justify-content: flex-end; flex-wrap: wrap; }
    .logs-fs-toolbar { flex-direction: column; gap: 0.5rem; }
    .logs-fs-search { margin-left: 0; }
    .logs-fs-search input { width: 100%; }
    .log-header { flex-direction: column; align-items: flex-start; gap: 0.4rem; }
    .log-q { white-space: normal; }
    .log-badges { width: 100%; flex-wrap: wrap; }
    .logs-launch-bar { flex-direction: column; }
    .logs-launch-buttons { width: 100%; flex-direction: column; }
    .elems-grid { grid-template-columns: 1fr; }
    .rag-card-top { flex-direction: column; align-items: flex-start; }
    .rag-score-bar { margin-left: 0; width: 100%; }
}

/* â•â•â•â•â•â•â• Config bar â•â•â•â•â•â•â• */
.config-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.config-panel {
    background: var(--bg-secondary, rgba(255,255,255,0.03));
    border: 1px solid var(--border, rgba(255,255,255,0.08));
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    animation: slideDownConfig 0.2s ease;
}

@keyframes slideDownConfig {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.form-hint {
    font-size: 0.78rem;
    color: var(--text-muted, #888);
    margin-top: 0.35rem;
}

/* â•â•â•â•â•â•â• Document choice section â•â•â•â•â•â•â• */

/* â”€â”€ RAG Selector â”€â”€ */
.rag-selector {
    margin-bottom: 1.25rem;
    padding: 1rem;
    border-radius: 12px;
    background: var(--bg-secondary, rgba(255,255,255,0.03));
    border: 1px solid var(--border, rgba(255,255,255,0.08));
}

.rag-selector-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary, #fff);
}

.rag-selector-buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.rag-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    padding: 0.75rem 1.25rem;
    border-radius: 10px;
    border: 2px solid var(--border, rgba(255,255,255,0.1));
    background: var(--bg-primary, rgba(0,0,0,0.2));
    color: var(--text-secondary, #aaa);
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 140px;
    position: relative;
}

.rag-btn:hover {
    border-color: var(--primary, #6366f1);
    color: var(--text-primary, #fff);
    background: rgba(99, 102, 241, 0.06);
}

.rag-btn.active {
    border-color: var(--primary, #6366f1);
    background: rgba(99, 102, 241, 0.12);
    color: var(--text-primary, #fff);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
}

.rag-btn.active::after {
    content: '✓';
    position: absolute;
    top: 6px;
    right: 8px;
    font-size: 0.8rem;
    color: var(--primary, #6366f1);
    font-weight: 700;
}

.rag-btn .icon-sm {
    width: 18px;
    height: 18px;
    color: var(--primary, #6366f1);
}

.rag-btn span {
    font-weight: 600;
    font-size: 0.9rem;
}

.rag-btn small {
    font-size: 0.68rem;
    color: var(--text-muted, #888);
    font-family: 'JetBrains Mono', monospace;
}

.rag-btn.disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

.rag-btn.disabled::before {
    content: '🔒';
    position: absolute;
    top: 6px;
    right: 8px;
    font-size: 0.75rem;
}

.rag-hint {
    text-align: center;
    margin-top: 0.5rem;
    margin-bottom: 0;
}

/* â”€â”€ Regulation Manager â”€â”€ */
.regulation-manager {
    margin-top: 1.25rem;
    padding: 1rem;
    border-radius: 12px;
    background: var(--bg-secondary, rgba(255,255,255,0.03));
    border: 1px solid var(--border, rgba(255,255,255,0.08));
}

.regulation-upload-zone {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: 2px dashed var(--border, rgba(255,255,255,0.15));
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.82rem;
    color: var(--text-secondary, #aaa);
    transition: all 0.2s ease;
    margin-bottom: 0.75rem;
}

.regulation-upload-zone:hover,
.regulation-upload-zone.drag-over {
    border-color: var(--primary, #6366f1);
    background: rgba(99, 102, 241, 0.06);
    color: var(--text-primary, #fff);
}

.regulation-ingest-progress {
    margin-bottom: 0.75rem;
}

.progress-bar-mini {
    height: 6px;
    border-radius: 3px;
    background: var(--bg-primary, rgba(0,0,0,0.3));
    overflow: hidden;
    margin-bottom: 0.4rem;
}

.progress-fill-mini {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--primary, #6366f1), var(--primary-light, #818cf8));
    transition: width 0.3s ease;
}

.regulation-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.regulation-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.8rem;
    border-radius: 8px;
    background: var(--bg-primary, rgba(0,0,0,0.2));
    border: 1px solid var(--border, rgba(255,255,255,0.08));
}

.regulation-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.regulation-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary, #fff);
}

.regulation-meta {
    font-size: 0.7rem;
    color: var(--text-muted, #888);
    font-family: 'JetBrains Mono', monospace;
}

.regulation-actions {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.btn-danger-ghost {
    background: none;
    border: none;
    color: var(--text-muted, #888);
    cursor: pointer;
    padding: 0.3rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.btn-danger-ghost:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

/* â”€â”€ Regulation Selector â”€â”€ */
.regulation-selector {
    margin-bottom: 1.25rem;
    padding: 1rem;
    border-radius: 12px;
    background: var(--bg-secondary, rgba(255,255,255,0.03));
    border: 1px solid var(--border, rgba(255,255,255,0.08));
}

.regulation-selector .rag-selector-buttons {
    flex-wrap: wrap;
}

.reg-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    border: 2px solid var(--border, rgba(255,255,255,0.15));
    background: var(--bg-secondary, rgba(255,255,255,0.03));
    color: var(--text-primary, #fff);
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 120px;
    position: relative;
}

.reg-btn:hover {
    border-color: var(--primary, #6366f1);
    background: rgba(99, 102, 241, 0.08);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.15);
}

.reg-btn.active {
    border-color: var(--primary, #6366f1);
    background: rgba(99, 102, 241, 0.12);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
}

.reg-btn.active::before {
    content: '\2713';
    position: absolute;
    top: 6px;
    left: 8px;
    font-size: 0.7rem;
    color: var(--primary, #6366f1);
    font-weight: 700;
}

.reg-btn .icon-sm {
    width: 22px;
    height: 22px;
    color: var(--primary, #6366f1);
}

.reg-btn span {
    font-weight: 600;
    font-size: 0.9rem;
}

.reg-btn small {
    font-size: 0.7rem;
    color: var(--text-muted, #888);
    font-family: 'JetBrains Mono', monospace;
}

.reg-btn .reg-delete-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    background: none;
    border: none;
    color: var(--text-muted, #888);
    cursor: pointer;
    padding: 2px;
    border-radius: 4px;
    opacity: 0;
    transition: all 0.2s ease;
    line-height: 1;
}

.reg-btn:hover .reg-delete-btn {
    opacity: 1;
}

.reg-btn .reg-delete-btn:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.15);
}

.reg-btn .reg-graph-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    background: none;
    border: none;
    color: var(--text-muted, #888);
    cursor: pointer;
    padding: 2px;
    border-radius: 4px;
    opacity: 0;
    transition: all 0.2s ease;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Quand un bouton suppression existe, dÃ©cale le bouton graphe Ã  sa gauche */
.reg-btn .reg-graph-btn:has(+ .reg-delete-btn) {
    right: 26px;
}

.reg-btn:hover .reg-graph-btn {
    opacity: 1;
}

.reg-btn .reg-graph-btn:hover {
    color: #6366f1;
    background: rgba(99, 102, 241, 0.15);
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   Modale de visualisation du graphe de connaissances (intÃ©grÃ©e)
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
.graph-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(8, 12, 24, 0.72);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 24px;
    opacity: 0;
    transition: opacity 0.18s ease;
}

.graph-modal-overlay.is-visible {
    display: flex;
    opacity: 1;
}

body.graph-modal-open {
    overflow: hidden;
}

.graph-modal {
    width: min(1400px, 96vw);
    height: min(880px, 94vh);
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 14px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: graphModalIn 0.2s ease both;
}

@keyframes graphModalIn {
    from { transform: translateY(12px) scale(0.98); opacity: 0; }
    to   { transform: translateY(0) scale(1);        opacity: 1; }
}

.graph-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: linear-gradient(90deg, #1e293b 0%, #334155 100%);
    border-bottom: 1px solid #334155;
    color: #e2e8f0;
    flex-shrink: 0;
}

.graph-modal-title {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.graph-modal-actions {
    display: flex;
    gap: 6px;
}

.graph-modal-btn {
    background: rgba(255, 255, 255, 0.06);
    color: #e2e8f0;
    border: 1px solid #475569;
    border-radius: 6px;
    padding: 5px 7px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.graph-modal-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: #64748b;
}

.graph-modal-btn i,
.graph-modal-btn svg {
    width: 16px;
    height: 16px;
}

.graph-modal-iframe {
    flex: 1 1 auto;
    width: 100%;
    border: 0;
    background: #0f172a;
}

/* Role selector (fournisseur / deployeur / both) */
.role-selector {
    margin-bottom: 1.25rem;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    background: var(--bg-secondary, rgba(255,255,255,0.03));
    border: 1px solid var(--border, rgba(255,255,255,0.08));
}

.role-selector .rag-selector-buttons {
    flex-wrap: wrap;
}

.role-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.85rem 1.25rem;
    border-radius: 12px;
    border: 2px solid var(--border, rgba(255,255,255,0.15));
    background: var(--bg-secondary, rgba(255,255,255,0.03));
    color: var(--text-primary, #fff);
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 130px;
    position: relative;
}

.role-btn:hover {
    border-color: var(--primary, #6366f1);
    background: rgba(99, 102, 241, 0.08);
    transform: translateY(-2px);
}

.role-btn.active {
    border-color: var(--primary, #6366f1);
    background: rgba(99, 102, 241, 0.12);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
}

.role-btn.active::before {
    content: '\2713';
    position: absolute;
    top: 6px;
    left: 8px;
    font-size: 0.7rem;
    color: var(--primary, #6366f1);
    font-weight: 700;
}

.role-btn .icon-sm {
    width: 20px;
    height: 20px;
    color: var(--primary, #6366f1);
}

.role-btn span {
    font-weight: 600;
    font-size: 0.9rem;
}

.role-btn small {
    font-size: 0.7rem;
    color: var(--text-muted, #888);
}

.doc-choice-section {
    margin-bottom: 1.25rem;
}

.doc-choice-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.doc-choice-label-row .doc-choice-label {
    margin-bottom: 0;
}

.doc-choice-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary, #fff);
}

.doc-choice-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.btn-doc-default {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    border: 2px solid var(--border, rgba(255,255,255,0.1));
    background: var(--bg-secondary, rgba(255,255,255,0.03));
    color: var(--text-primary, #fff);
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 120px;
}

.btn-doc-default:hover {
    border-color: var(--primary, #6366f1);
    background: rgba(99, 102, 241, 0.08);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.15);
}

.btn-doc-default:active {
    transform: translateY(0);
}

.btn-doc-default .icon {
    width: 28px;
    height: 28px;
    color: var(--primary, #6366f1);
}

.btn-doc-default span {
    font-weight: 600;
    font-size: 0.95rem;
}

.btn-doc-default small {
    font-size: 0.72rem;
    color: var(--text-muted, #888);
    font-family: 'JetBrains Mono', monospace;
}

.doc-choice-separator {
    color: var(--text-muted, #888);
    font-size: 0.85rem;
    font-style: italic;
    padding: 0 0.25rem;
}

/* â”€â”€ Last Result subtle green pill (in config-bar) â”€â”€ */
.btn-last-result {
    color: #10b981 !important;
    border-color: rgba(16, 185, 129, 0.3) !important;
}

.btn-last-result .icon-sm {
    color: #10b981;
}

.btn-last-result:hover {
    background: rgba(16, 185, 129, 0.1) !important;
    border-color: #10b981 !important;
}


/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
/* Progressive Loading â€” Inline Progress */
/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

.inline-progress {
    background: var(--bg-card);
    border: 1px solid var(--primary);
    border-radius: var(--radius);
    padding: 12px 20px;
    margin-bottom: 24px;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.1);
}

.inline-progress-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.inline-progress-label {
    font-weight: 600;
    font-size: 13px;
    color: var(--primary-light);
}

.inline-progress-text {
    margin-left: auto;
    font-size: 12px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-muted);
}

.inline-progress-bar {
    height: 6px;
    background: var(--bg-surface);
    border-radius: 3px;
    overflow: hidden;
}

.inline-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light), #a78bfa);
    background-size: 200% auto;
    border-radius: 3px;
    transition: width 0.5s ease;
    animation: shimmer 2s linear infinite;
}

/* Small spinner for progressive category headers */
.spinner-sm {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

/* Pending verdict icon (during evaluation) */
.verdict-icon-pending {
    background: var(--bg-surface);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
}

.verdict-pending {
    background: var(--bg-surface);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

/* Fade-in animation for progressive items */
.fade-in-up {
    animation: fadeInUp 0.4s ease both;
}

.checkpoint-appear {
    animation: checkpointSlideIn 0.35s ease both;
}

@keyframes checkpointSlideIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   HISTORY MODAL
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

.history-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.history-modal {
    width: 90%;
    max-width: 650px;
    max-height: 80vh;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.25s ease;
}

.history-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.history-modal-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text-primary);
}
.history-modal-title h2 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
}
.history-modal-title .icon {
    color: var(--primary);
}

.history-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.history-modal-body::-webkit-scrollbar { width: 6px; }
.history-modal-body::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 3px; }

.history-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all 0.2s;
}
.history-item:hover {
    border-color: var(--primary);
    box-shadow: var(--glow-primary);
}

.history-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.history-item-file {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-item-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

.history-item-score {
    font-size: 1rem;
    font-weight: 800;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    flex-shrink: 0;
}
.history-score-high { background: rgba(16, 185, 129, 0.15); color: var(--success); border: 1px solid var(--success); }
.history-score-mid { background: rgba(245, 158, 11, 0.15); color: var(--warning); border: 1px solid var(--warning); }
.history-score-low { background: rgba(239, 68, 68, 0.15); color: var(--danger); border: 1px solid var(--danger); }

.btn-history-view {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.45rem 0.9rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    white-space: nowrap;
}
.btn-history-view:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--glow-primary);
}

.history-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 2rem;
    color: var(--text-muted);
}

.history-empty {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-style: italic;
}

@media (max-width: 768px) {
    .history-modal { width: 95%; max-height: 90vh; }
    .history-item { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
    .history-item-score { align-self: flex-start; }
    .btn-history-view { width: 100%; justify-content: center; }
}
/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•

/* ═════════════════════════════════════════════════════════════
   SIDE NAV + EXPLORER  (aligné sur les tokens globaux)
   ═════════════════════════════════════════════════════════════ */

/* ── Side nav gauche (mêmes tokens que .navbar / .btn-icon) ── */
.side-nav {
    position: fixed;
    top: 80px;
    left: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    z-index: 90;
    box-shadow: var(--shadow);
}

.side-nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 56px;
    padding: 10px 6px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.side-nav-btn:hover {
    background: var(--bg-surface);
    color: var(--text-primary);
    border-color: var(--border-hover);
}
.side-nav-btn.active {
    background: rgba(99, 102, 241, 0.12);
    border-color: var(--border-hover);
    color: var(--primary-light);
    box-shadow: var(--glow-primary);
}
.side-nav-btn .icon { width: 20px; height: 20px; }
.side-nav-label { font-size: 10px; }

@media (max-width: 900px) {
    .side-nav {
        top: auto;
        bottom: 16px;
        left: 50%;
        transform: translateX(-50%);
        flex-direction: row;
    }
    .side-nav-btn { flex-direction: row; width: auto; padding: 8px 14px; }
}

/* ── Section Explorer — layout vertical (docs top / graph middle / chat bottom) ── */
.explorer-section {
    max-width: none;
    width: 100%;
    margin: 0;
    padding: 12px 16px 16px 96px;
}
@media (max-width: 900px) {
    .explorer-section { padding: 12px 12px 96px 12px; }
}

.explorer-layout {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
    gap: 10px;
    height: calc(100vh - 70px);
    min-height: 720px;
}
@media (max-width: 900px) {
    .explorer-layout {
        grid-template-columns: 1fr;
        height: auto;
    }
}

/* Sous-panneaux — même look que .card / .glass-card */
.explorer-docs,
.explorer-main,
.explorer-chat {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header de panneau (uniforme) */
.explorer-docs-header,
.explorer-chat-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--text-secondary);
}

/* Titre Graph Chat — aligné sur la taille/police de .explorer-doc-name */
.explorer-chat-header {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: normal;
    text-transform: none;
    color: var(--text-primary);
}

/* Bandeau docs (pleine largeur en haut) */
.explorer-docs-top { flex-direction: row; align-items: stretch; }
.explorer-docs-top .explorer-docs-header {
    border-bottom: none;
    border-right: 1px solid var(--border);
    white-space: nowrap;
    flex-shrink: 0;
}
.explorer-docs-top .explorer-docs-list {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 8px 10px;
    gap: 8px;
    align-items: center;
}
.explorer-docs-top .explorer-doc-pill {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    white-space: nowrap;
    flex-shrink: 0;
    max-width: 340px;
}
.explorer-docs-top .explorer-doc-name-pill {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
    word-break: normal;
}

/* Colonne docs (fallback vertical) */
.explorer-docs-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.explorer-docs-empty {
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
    padding: 20px 8px;
    font-style: italic;
}
.explorer-doc-pill {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 10px 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}
.explorer-doc-pill:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
}
.explorer-doc-pill.active {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.10);
    box-shadow: var(--glow-primary);
}
.explorer-doc-badge {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--bg-surface);
    color: var(--text-muted);
    border: 1px solid var(--border);
}
.explorer-doc-badge-builtin {
    background: rgba(99, 102, 241, 0.12);
    color: var(--primary-light);
    border-color: var(--border-hover);
}
.explorer-doc-name-pill {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    word-break: break-word;
}
.explorer-doc-meta {
    font-size: 11px;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

/* Colonne principale (canvas) */
.explorer-main { position: relative; display: flex; flex-direction: column; min-height: 0; }

.explorer-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    background: var(--bg-card);
    position: relative;
    z-index: 3;
    flex-shrink: 0;
}
.explorer-toolbar-left {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 2px;
}
.explorer-doc-name {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 420px;
}
.explorer-stats {
    color: var(--text-muted);
    font-size: 11px;
    font-family: 'JetBrains Mono', monospace;
}
.explorer-toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Inputs/selects — alignés sur la langue du reste de l'app */
.explorer-search,
.explorer-layout-select {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 7px 12px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s ease, background 0.2s ease;
}
.explorer-search::placeholder { color: var(--text-muted); }
.explorer-search:focus,
.explorer-layout-select:focus {
    border-color: var(--primary);
    background: var(--bg-card-hover);
}
.explorer-search { width: 180px; }

/* Filtres types — look "pill" discret */
.explorer-filters {
    display: flex;
    gap: 6px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    flex-wrap: wrap;
    background: var(--bg-card);
    position: relative;
    z-index: 3;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}
.explorer-filters:empty { display: none; }
.explorer-chip {
    --chip-color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}
.explorer-chip .explorer-chip-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--chip-color);
}
.explorer-chip:hover { border-color: var(--border-hover); }
.explorer-chip.active {
    color: var(--text-primary);
    border-color: var(--chip-color);
}
.explorer-chip:not(.active) {
    opacity: 0.4;
    text-decoration: line-through;
}
.explorer-chip-count {
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
}

/* Canvas Cytoscape — même style que le graph_view standalone */
.explorer-canvas {
    flex: 1;
    min-height: 420px;
    background: #0b1220;
    position: relative;
    z-index: 1;
    overflow: hidden;
}
[data-theme="light"] .explorer-canvas {
    background: #0f172a;
}

/* Bandeau chat bas (pleine largeur, repliable) */
.explorer-chat-bottom {
    max-height: 340px;
    transition: max-height 0.25s ease;
}
.explorer-chat-bottom.collapsed {
    max-height: 44px;
}
.explorer-chat-toggle {
    width: 100%;
    background: var(--bg-card);
    cursor: pointer;
    border: none;
    border-bottom: 1px solid var(--border);
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: normal;
    text-transform: none;
    color: var(--text-primary);
    text-align: left;
    transition: background 0.15s ease, color 0.15s ease;
}
.explorer-chat-toggle:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}
.explorer-chat-toggle .explorer-chat-chevron {
    margin-left: auto;
    transition: transform 0.25s ease;
}
.explorer-chat-bottom.collapsed .explorer-chat-toggle .explorer-chat-chevron {
    transform: rotate(180deg);
}
.explorer-chat-bottom.collapsed .explorer-chat-toggle {
    border-bottom-color: transparent;
}
.explorer-chat-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}
.explorer-chat-bottom.collapsed .explorer-chat-body { display: none; }
.explorer-chat-bottom .explorer-chat-messages { max-height: 230px; }
.explorer-loading,
.explorer-error {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 13px;
    font-style: italic;
}
.explorer-error { color: var(--danger-light); }

/* Détail d'un nœud */
.explorer-node-info {
    position: absolute;
    bottom: 12px;
    left: 12px;
    right: 12px;
    max-height: 40%;
    overflow-y: auto;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
    color: var(--text-primary);
    font-size: 12px;
    box-shadow: var(--shadow-lg);
    z-index: 3;
}
.explorer-node-info-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.explorer-node-info-type {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #fff;
    padding: 2px 8px;
    border-radius: 999px;
}
.explorer-node-info-title {
    font-weight: 700;
    color: var(--text-primary);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}
.explorer-node-info-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 0 6px;
    transition: color 0.15s ease;
}
.explorer-node-info-close:hover { color: var(--text-primary); }
.explorer-node-info-txt {
    margin-top: 6px;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.55;
}
.explorer-node-info-meta {
    font-size: 11px;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}
.explorer-node-info-meta code {
    color: var(--text-secondary);
}

/* Panneau chat (mêmes conventions que .chatbot-panel) */
.explorer-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.explorer-chat-msg { display: flex; }
.explorer-chat-msg-bot  { justify-content: flex-start; }
.explorer-chat-msg-user { justify-content: flex-end; }
.explorer-chat-msg-content {
    max-width: 88%;
    padding: 9px 12px;
    border-radius: var(--radius);
    font-size: 13px;
    line-height: 1.55;
    white-space: pre-wrap;
    word-wrap: break-word;
}
.explorer-chat-msg-bot .explorer-chat-msg-content {
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
}
.explorer-chat-msg-user .explorer-chat-msg-content {
    background: var(--primary);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.explorer-chat-typing {
    color: var(--text-muted);
    font-style: italic;
}
.explorer-chat-error {
    color: var(--danger-light);
    font-size: 12px;
}
.explorer-chat-input-area {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid var(--border);
}
.explorer-chat-input {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s ease;
}
.explorer-chat-input::placeholder { color: var(--text-muted); }
.explorer-chat-input:focus { border-color: var(--primary); }
.explorer-chat-input:disabled { opacity: 0.5; cursor: not-allowed; }

.explorer-chat-send {
    width: 38px;
    height: 38px;
    background: var(--primary);
    border: none;
    border-radius: var(--radius-sm);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.12s ease;
}
.explorer-chat-send:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
}
.explorer-chat-send:disabled {
    background: var(--bg-surface);
    color: var(--text-muted);
    cursor: not-allowed;
}

/* Plein écran */
.explorer-section.explorer-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 1500;
    padding: 12px;
    background: var(--bg-body);
    overflow: auto;
    max-width: none;
    margin: 0;
}
.explorer-section.explorer-fullscreen .explorer-layout {
    height: calc(100vh - 24px);
}
