/* ===================================================================
   ASK FOR DATA - MODERN DESIGN SYSTEM (Light Theme)
   Clean, Professional, Accessible, Vibrant
   =================================================================== */

/* =========================
   CSS VARIABLES & TOKENS
   ========================= */
:root {
    /* Color Palette - Modern Corporate + CI Identity */
    --bg-body: #f8fafc;       /* Slate 50 */
    --bg-surface: #ffffff;    /* White */
    --bg-surface-alt: #f1f5f9; /* Slate 100 */

    /* Primary Colors */
    --primary: #f97316;       /* Orange 500 */
    --primary-hover: #ea580c; /* Orange 600 */
    --primary-light: #fff7ed; /* Orange 50 */
    
    --secondary: #16a34a;     /* Green 600 */
    --secondary-hover: #15803d; /* Green 700 */
    --secondary-light: #f0fdf4; /* Green 50 */

    /* Accents */
    --accent-blue: #3b82f6;
    --accent-purple: #8b5cf6;

    /* Text Colors */
    --text-main: #0f172a;     /* Slate 900 */
    --text-body: #334155;     /* Slate 700 */
    --text-muted: #64748b;    /* Slate 500 */
    --text-inverse: #ffffff;  /* White */

    /* Borders */
    --border-light: #e2e8f0;  /* Slate 200 */
    --border-hover: #cbd5e1;  /* Slate 300 */

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-colored: 0 10px 15px -3px rgba(249, 115, 22, 0.2);

    /* Spacing & Layout */
    --container-width: 1200px;
    --header-height: 80px;
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;

    /* Focus */
    --focus-ring: #2563eb;

    /* Transitions */
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =========================
   RESET & BASE STYLES
   ========================= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-body);
    color: var(--text-body);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text-main);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    font-family: 'Inter', sans-serif; 
}

h1 { font-size: 3rem; letter-spacing: -0.025em; }
h2 { font-size: 2.25rem; letter-spacing: -0.025em; }
h3 { font-size: 1.5rem; }

p { margin-bottom: 1rem; }

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
}

a:hover { color: var(--primary-hover); }

/* =========================
   LAYOUT
   ========================= */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
}

main {
    flex: 1;
}

main.dashboard-main {
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* =========================
   IVORIAN TRICOLOR ACCENT
   ========================= */
.ci-tricolor {
    height: 4px;
    background: linear-gradient(90deg, #f97316 0%, #f97316 33.33%, #ffffff 33.33%, #ffffff 66.66%, #16a34a 66.66%, #16a34a 100%);
    position: sticky;
    top: 0;
    z-index: 1002;
    flex-shrink: 0;
}

/* =========================
   ACCESSIBILITY: SKIP LINK & FOCUS
   ========================= */
.skip-link {
    position: absolute;
    left: 1rem;
    top: -100px;
    z-index: 2000;
    background: var(--text-main);
    color: #fff;
    padding: 0.65rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: top 0.15s ease;
}
.skip-link:focus { top: 0.75rem; color: #fff; }

:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
}
main:focus { outline: none; }

/* =========================
   HEADER & NAV
   ========================= */
header {
    background: rgba(255, 255, 255, 0.96);
    -webkit-backdrop-filter: saturate(160%) blur(8px);
    backdrop-filter: saturate(160%) blur(8px);
    position: sticky;
    top: 4px;
    z-index: 1001;
    height: var(--header-height);
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-light);
    box-shadow: 0 1px 0 rgba(249, 115, 22, 0.35), 0 4px 16px rgba(15, 23, 42, 0.05);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 1rem;
    position: relative;
}

.logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    border-radius: var(--radius-md);
}

.logo img {
    height: 46px;
    width: auto;
    display: block;
    transition: transform 0.2s ease;
}

.logo:hover img { transform: scale(1.03); }

/* ─── Center nav links ─── */
.nav-center {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    background: var(--bg-surface-alt);
    border-radius: 999px;
    padding: 4px;
    border: 1px solid var(--border-light);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--text-body);
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
    white-space: nowrap;
}

.nav-link i {
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.nav-link:hover { color: var(--text-main); background: #fff; }
.nav-link:hover i { color: var(--primary); }

.nav-link.active {
    color: #fff;
    background: var(--primary);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.28);
}
.nav-link.active i { color: #fff; }

/* ─── Right actions ─── */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.nav-login-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #fff;
    font-size: 0.88rem;
    font-weight: 600;
    padding: 0.55rem 1.2rem;
    border-radius: 999px;
    background: var(--primary);
    transition: background 0.2s ease, box-shadow 0.2s ease;
}
.nav-login-btn:hover {
    color: #fff;
    background: var(--primary-hover);
    box-shadow: 0 3px 10px rgba(249, 115, 22, 0.25);
}

/* Account dropdown */
.nav-account { position: relative; }
.nav-account summary { list-style: none; }
.nav-account summary::-webkit-details-marker { display: none; }

.nav-user-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: var(--text-body);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.4rem 0.8rem 0.4rem 0.5rem;
    border-radius: 999px;
    background: var(--secondary-light);
    border: 1px solid #bbf7d0;
    transition: background 0.2s ease, border-color 0.2s ease;
    user-select: none;
}
.nav-user-btn > .fa-user-circle { font-size: 1.15rem; color: var(--secondary); }
.nav-user-btn:hover { background: #dcfce7; border-color: #86efac; }
.nav-account-caret { font-size: 0.65rem; color: var(--text-muted); transition: transform 0.2s ease; }
.nav-account[open] .nav-account-caret { transform: rotate(180deg); }

.nav-account-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 250px;
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: 0.5rem;
    animation: navPop 0.16s ease-out;
}
.nav-account-who {
    font-size: 0.8rem;
    color: var(--text-muted);
    padding: 0.5rem 0.75rem 0.65rem;
    margin: 0 0 0.25rem;
    border-bottom: 1px solid var(--border-light);
    overflow-wrap: anywhere;
}
.nav-account-who strong { color: var(--text-main); font-weight: 600; }
.nav-account-menu a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-md);
    color: var(--text-body);
    font-size: 0.9rem;
}
.nav-account-menu a i { width: 16px; color: var(--text-muted); }
.nav-account-menu a:hover,
.nav-account-menu a.active { background: var(--primary-light); color: var(--primary-hover); }
.nav-account-menu a:hover i,
.nav-account-menu a.active i { color: var(--primary); }

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

/* ─── Hamburger ─── */
.nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: background 0.2s ease;
}
.nav-toggle:hover { background: rgba(249, 115, 22, 0.08); }
.nav-toggle-bars { position: relative; width: 20px; height: 14px; display: block; }
.nav-toggle-bars span {
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    border-radius: 2px;
    background: var(--text-main);
    transition: transform 0.22s ease, opacity 0.18s ease, top 0.22s ease;
}
.nav-toggle-bars span:nth-child(1) { top: 0; }
.nav-toggle-bars span:nth-child(2) { top: 6px; }
.nav-toggle-bars span:nth-child(3) { top: 12px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(1) { top: 6px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(3) { top: 6px; transform: rotate(-45deg); }

/* ─── Mobile menu (hidden on desktop) ─── */
.nav-mobile-menu,
.nav-backdrop { display: none; }

.nav-mobile-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem 1rem;
    color: var(--text-body);
    font-size: 0.98rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: background 0.2s ease, color 0.2s ease;
}
.nav-mobile-link i { width: 20px; text-align: center; color: var(--text-muted); font-size: 0.95rem; }
.nav-mobile-link:hover,
.nav-mobile-link.active { background: var(--primary-light); color: var(--primary-hover); }
.nav-mobile-link.active i,
.nav-mobile-link:hover i { color: var(--primary); }
.nav-mobile-link.active { font-weight: 600; box-shadow: inset 3px 0 0 var(--primary); }
.nav-mobile-cta { background: var(--primary); color: #fff; justify-content: center; font-weight: 600; }
.nav-mobile-cta i { color: #fff; }
.nav-mobile-cta:hover { background: var(--primary-hover); color: #fff; }
.nav-mobile-cta:hover i { color: #fff; }
.nav-mobile-who {
    font-size: 0.8rem;
    color: var(--text-muted);
    padding: 0.25rem 1rem 0.35rem;
    margin: 0;
    overflow-wrap: anywhere;
}

.nav-mobile-divider {
    height: 1px;
    background: var(--border-light);
    margin: 0.5rem 0;
}

/* =========================
   COMPONENTS
   ========================= */
/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    gap: 0.5rem;
    font-size: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #f59e0b 100%);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(249, 115, 22, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #ea580c 0%, #d97706 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 8px -1px rgba(249, 115, 22, 0.4);
}

.btn-secondary {
    background: var(--secondary);
    color: white;
}

.btn-secondary:hover {
    background: var(--secondary-hover);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-body);
}

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

/* Cards */
.card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-lg);
    border-color: rgba(249, 115, 22, 0.3);
    transform: translateY(-2px);
}

/* Inputs */
.input-group {
    position: relative;
    display: flex;
    gap: 0.5rem;
}

input[type="text"], 
textarea, 
select {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    color: var(--text-main);
    font-size: 1rem;
    transition: var(--transition);
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

/* =========================
   HERO SECTION (Enhanced 3D)
   ========================= */
.hero {
    padding: 6rem 0 4rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    /* Vibrant mesh gradient background with depth */
    background: 
        radial-gradient(at 0% 0%, rgba(249, 115, 22, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(22, 163, 74, 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(59, 130, 246, 0.05) 0px, transparent 50%),
        radial-gradient(at 0% 100%, rgba(236, 72, 153, 0.05) 0px, transparent 50%),
        var(--bg-body);
    perspective: 1000px;
    transform-style: preserve-3d;
}

/* Abstract Background Pattern */
.hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: 
        linear-gradient(rgba(249, 115, 22, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(249, 115, 22, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(circle at center, black 40%, transparent 100%);
    -webkit-mask-image: radial-gradient(circle at center, black 40%, transparent 100%);
    z-index: -1;
}

/* Hero Background Elements */
.hero-bg-elements {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.floating-icon {
    position: absolute;
    font-size: 2.5rem;
    color: rgba(249, 115, 22, 0.08);
    animation: float3D 8s ease-in-out infinite;
    filter: blur(0.5px);
    transition: all 0.3s ease;
}

.floating-icon:nth-child(1) { 
    animation-delay: 0s; 
    animation-name: float3D-1;
}
.floating-icon:nth-child(2) { 
    animation-delay: 1s; 
    color: rgba(34, 197, 94, 0.08); 
    animation-name: float3D-2;
}
.floating-icon:nth-child(3) { 
    animation-delay: 2s;
    animation-name: float3D-3; 
}
.floating-icon:nth-child(4) { 
    animation-delay: 3s; 
    color: rgba(59, 130, 246, 0.08);
    animation-name: float3D-4; 
}
.floating-icon:nth-child(5) { 
    animation-delay: 4s; 
    color: rgba(139, 92, 246, 0.08);
    animation-name: float3D-5; 
}

@keyframes float3D-1 {
    0%, 100% { transform: translateY(0) translateZ(0) rotate(0deg); }
    25% { transform: translateY(-15px) translateZ(20px) rotate(3deg); }
    50% { transform: translateY(-25px) translateZ(40px) rotate(5deg); }
    75% { transform: translateY(-15px) translateZ(20px) rotate(3deg); }
}

@keyframes float3D-2 {
    0%, 100% { transform: translateY(0) translateZ(0) rotate(0deg) scale(1); }
    33% { transform: translateY(-20px) translateZ(30px) rotate(-4deg) scale(1.05); }
    66% { transform: translateY(-10px) translateZ(15px) rotate(-2deg) scale(1.02); }
}

@keyframes float3D-3 {
    0%, 100% { transform: translateY(0) translateZ(0) rotateY(0deg); }
    50% { transform: translateY(-30px) translateZ(50px) rotateY(10deg); }
}

@keyframes float3D-4 {
    0%, 100% { transform: translateY(0) translateZ(0) rotate(0deg); }
    40% { transform: translateY(-18px) translateZ(35px) rotate(6deg); }
    80% { transform: translateY(-8px) translateZ(15px) rotate(2deg); }
}

@keyframes float3D-5 {
    0%, 100% { transform: translateY(0) translateZ(0) scale(1); }
    50% { transform: translateY(-22px) translateZ(45px) scale(1.08); }
}

/* Hero Badge */
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(249, 115, 22, 0.1);
    border: 1px solid rgba(249, 115, 22, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 1.5rem;
    animation: fadeInDown 0.6s ease-out, floatBadge 3s ease-in-out infinite;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.15);
    backdrop-filter: blur(8px);
}

@keyframes floatBadge {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.badge-dot {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    animation: pulse-dot 2s ease-in-out infinite;
}

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

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

/* Hero Title Enhanced - Fixed Alignment */
.hero-title {
    font-size: 5rem;
    font-weight: 900;
    letter-spacing: -0.05em;
    margin-bottom: 1.5rem;
    line-height: 1.1;
    animation: fadeInUp 0.8s ease-out;
    text-align: center;
}

.title-main {
    display: inline-block;
    color: var(--text-main);
    position: relative;
    text-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

.title-highlight {
    background: linear-gradient(135deg, #f97316 0%, #22c55e 50%, #f97316 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 4s ease-in-out infinite;
    position: relative;
}

.title-highlight::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #f97316, #22c55e);
    border-radius: 2px;
    animation: underlineExpand 1s ease-out 0.5s both;
}

@keyframes underlineExpand {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% center; }
    50% { background-position: 100% center; }
}

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

.hero h1 {
    font-size: 4.5rem;
    font-weight: 800;
    letter-spacing: -0.05em;
    background: linear-gradient(135deg, #0f172a 30%, #f97316 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1.5rem;
    position: relative;
    display: inline-block;
}

.subtitle {
    font-size: 1.35rem;
    color: var(--text-body);
    max-width: 700px;
    margin: 0 auto 1rem;
    line-height: 1.6;
    animation: fadeInUp 1s ease-out;
}

.hero-description {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 650px;
    margin: 0 auto 2.5rem;
    line-height: 1.7;
    animation: fadeInUp 1.2s ease-out;
}

/* =========================
   SEARCH & RESULTS (Fixed)
   ========================= */
.search-container {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 50;
}

/* Glassmorphism Search Bar with 3D depth */
.search-container form {
    box-shadow: 
        0 20px 25px -5px rgba(0, 0, 0, 0.1), 
        0 8px 10px -6px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px) saturate(180%);
    padding: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.6);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    transform-style: preserve-3d;
}

.search-container form::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.1), rgba(34, 197, 94, 0.1));
    border-radius: var(--radius-lg);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: -1;
    filter: blur(8px);
}

.search-container form:focus-within {
    transform: translateY(-4px) translateZ(20px);
    box-shadow: 
        0 30px 60px -12px rgba(249, 115, 22, 0.3),
        0 0 0 1px rgba(249, 115, 22, 0.2) inset;
    border-color: rgba(249, 115, 22, 0.4);
}

.search-container form:focus-within::before {
    opacity: 1;
}

.search-container .input-group {
    position: relative;
    display: flex;
    align-items: center;
}

#query-input {
    border: none;
    background: transparent;
    padding: 1rem 1.5rem;
    padding-right: 200px; /* Space for button */
    font-size: 1.125rem;
    box-shadow: none;
    height: 60px;
}

#query-input:focus {
    box-shadow: none;
    outline: none;
}

.search-container button[type="submit"] {
    position: absolute;
    right: 4px;
    top: 4px;
    bottom: 4px;
    border-radius: var(--radius-md);
    padding: 0 2rem;
    font-size: 1rem;
    background: linear-gradient(135deg, var(--primary) 0%, #f59e0b 100%);
    border: none;
    box-shadow: 0 4px 6px -1px rgba(249, 115, 22, 0.3);
    color: white;
}

.search-container button[type="submit"]:hover {
    background: linear-gradient(135deg, #ea580c 0%, #d97706 100%);
    box-shadow: 0 10px 15px -3px rgba(249, 115, 22, 0.4);
    transform: translateY(-1px);
}

/* Autocomplete Styling - Fixed Positioning */
.autocomplete-container {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 40px rgba(0,0,0,0.12);
    z-index: 100;
    max-height: 350px;
    overflow-y: auto;
    padding: 0.5rem;
    animation: slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.autocomplete-item {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s ease;
    margin-bottom: 2px;
}

.autocomplete-item:hover {
    background: var(--primary-light);
}

.autocomplete-icon {
    font-size: 1.25rem;
    background: rgba(249, 115, 22, 0.1);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--primary);
}

.autocomplete-text {
    flex: 1;
}

.autocomplete-name {
    font-weight: 500;
    color: var(--text-main);
}

.autocomplete-code {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* Example Buttons */
.examples {
    margin-top: 2rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    animation: fadeInUp 1.4s ease-out;
}

.btn-example {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border-light);
    color: var(--text-muted);
    padding: 0.6rem 1.25rem;
    border-radius: 2rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(4px);
    position: relative;
    overflow: hidden;
}

.btn-example::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--primary), #22c55e);
    opacity: 0;
    transition: opacity 0.3s;
}

.btn-example:hover {
    border-color: var(--primary);
    color: white;
    background: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(249, 115, 22, 0.3);
}

/* Recommendation Chips */
.recommendations-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.recommendation-chip {
    background: linear-gradient(135deg, #fff7ed, #fef3c7);
    border: 1px solid rgba(249, 115, 22, 0.2);
    color: var(--primary);
    padding: 0.6rem 1.25rem;
    border-radius: 2rem;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.recommendation-chip:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(249, 115, 22, 0.25);
}

/* Stats Counter Animation */
.stat-counter {
    font-size: 3rem;
    font-weight: 800;
    color: var(--primary);
    display: block;
    margin-bottom: 0.5rem;
}

/* Feature Cards Enhanced */
.features-section .card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.features-section .card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), #22c55e);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.features-section .card:hover::before {
    transform: scaleX(1);
}

.features-section .card:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

/* =========================
   RESULTS SECTION
   ========================= */
.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-2 { grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

.chart-container {
    position: relative;
    height: 400px;
    width: 100%;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th, .data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.data-table th {
    background: var(--bg-surface-alt);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.data-table tr:last-child td { border-bottom: none; }

/* =========================
   FOOTER
   ========================= */
footer {
    background: #0f172a;
    border-top: 3px solid var(--primary);
    padding: 3.5rem 0 0;
    margin-top: auto;
    color: #94a3b8;
}

.footer-content {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr 1fr;
    gap: 2.5rem;
    margin-bottom: 2.5rem;
}

.footer-logo {
    height: 48px;
    width: auto;
    margin-bottom: 1rem;
}

.footer-section p.text-muted {
    color: #94a3b8;
    line-height: 1.7;
    font-size: 0.9rem;
    max-width: 34ch;
}

.footer-refresh {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.1rem 0.5rem;
    font-size: 0.82rem;
    color: #cbd5e1;
    margin: 0;
}
.footer-refresh-date { display: block; color: #94a3b8; }
.footer-refresh-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
    flex-shrink: 0;
    align-self: center;
}

.footer-title {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 1rem;
    color: #fb923c;
}

.footer-section ul { list-style: none; }
.footer-section ul li { margin-bottom: 0.55rem; }
.footer-section ul li a {
    color: #cbd5e1;
    font-weight: 400;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}
.footer-section ul li a:hover { color: #fb923c; text-decoration: underline; text-underline-offset: 3px; }

.footer-bottom {
    padding: 1.25rem 0;
    border-top: 1px solid #1e293b;
    color: #94a3b8;
    font-size: 0.8rem;
    background: #0a1122;
}
.footer-bottom .container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.5rem 2rem;
}
.footer-bottom p { margin: 0; }
.footer-bottom p + p { max-width: 70ch; }

/* =========================
   UTILITIES & STATES
   ========================= */
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 2rem; }

/* Loading - Futuristic AI Spinner */
.loading-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 41, 59, 0.98) 100%);
    backdrop-filter: blur(12px);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
}

/* Neural Network Spinner */
.spinner {
    position: relative;
    width: 120px;
    height: 120px;
}

.spinner::before,
.spinner::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid transparent;
}

.spinner::before {
    border-top-color: #f97316;
    border-right-color: #f97316;
    animation: spinClockwise 1.5s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite;
}

.spinner::after {
    inset: 12px;
    border-bottom-color: #22c55e;
    border-left-color: #22c55e;
    animation: spinCounterClockwise 1.2s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite;
}

/* Center brain icon */
.spinner-brain {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #f97316;
    animation: pulse 2s ease-in-out infinite;
    text-shadow: 0 0 20px rgba(249, 115, 22, 0.5);
}

/* Orbiting particles */
.spinner-particle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: linear-gradient(135deg, #f97316, #fbbf24);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(249, 115, 22, 0.6);
}

.spinner-particle:nth-child(1) {
    animation: orbit1 2s linear infinite;
}

.spinner-particle:nth-child(2) {
    animation: orbit2 2.5s linear infinite;
}

.spinner-particle:nth-child(3) {
    animation: orbit3 3s linear infinite;
}

@keyframes spinClockwise {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes spinCounterClockwise {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(-360deg); }
}

@keyframes pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    50% { transform: translate(-50%, -50%) scale(1.1); opacity: 0.8; }
}

@keyframes orbit1 {
    0% { transform: rotate(0deg) translateX(55px) rotate(0deg); }
    100% { transform: rotate(360deg) translateX(55px) rotate(-360deg); }
}

@keyframes orbit2 {
    0% { transform: rotate(120deg) translateX(55px) rotate(-120deg); }
    100% { transform: rotate(480deg) translateX(55px) rotate(-480deg); }
}

@keyframes orbit3 {
    0% { transform: rotate(240deg) translateX(55px) rotate(-240deg); }
    100% { transform: rotate(600deg) translateX(55px) rotate(-600deg); }
}

/* Loading text styling */
.loading-text {
    color: #ffffff !important;
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    background: linear-gradient(90deg, #f97316, #fbbf24, #22c55e, #f97316);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 3s linear infinite;
}

.loading-overlay .text-muted {
    color: rgba(255, 255, 255, 0.6) !important;
    font-size: 0.9rem;
}

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

/* Data stream effect */
.loading-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(0deg, transparent 24%, rgba(249, 115, 22, 0.03) 25%, rgba(249, 115, 22, 0.03) 26%, transparent 27%, transparent 74%, rgba(249, 115, 22, 0.03) 75%, rgba(249, 115, 22, 0.03) 76%, transparent 77%),
        linear-gradient(90deg, transparent 24%, rgba(34, 197, 94, 0.03) 25%, rgba(34, 197, 94, 0.03) 26%, transparent 27%, transparent 74%, rgba(34, 197, 94, 0.03) 75%, rgba(34, 197, 94, 0.03) 76%, transparent 77%);
    background-size: 50px 50px;
    animation: gridMove 20s linear infinite;
    pointer-events: none;
}

@keyframes gridMove {
    0% { transform: translateY(0); }
    100% { transform: translateY(50px); }
}

/* Inline Loading Spinner */
.inline-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    padding: 2rem;
    margin-top: 1.5rem;
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.03), rgba(34, 197, 94, 0.03));
    border-radius: var(--radius-xl);
    border: 1px solid rgba(249, 115, 22, 0.1);
    animation: fadeIn 0.3s ease-out;
}

.inline-spinner {
    position: relative;
    width: 80px;
    height: 80px;
    flex-shrink: 0;
}

.spinner-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid transparent;
}

.spinner-ring:nth-child(1) {
    border-top-color: #f97316;
    border-right-color: #f97316;
    animation: spinClockwise 1.2s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite;
}

.spinner-ring:nth-child(2) {
    inset: 8px;
    border-bottom-color: #22c55e;
    border-left-color: #22c55e;
    animation: spinCounterClockwise 1s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite;
}

.spinner-ring:nth-child(3) {
    inset: 16px;
    border-top-color: #3b82f6;
    border-bottom-color: #3b82f6;
    animation: spinClockwise 0.8s linear infinite;
}

.spinner-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5rem;
    color: #f97316;
    animation: pulse 1.5s ease-in-out infinite;
}

.loading-info {
    flex: 1;
    max-width: 400px;
}

.loading-status {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 1rem;
}

.loading-progress {
    display: flex;
    gap: 1rem;
}

.progress-step {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: white;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.progress-step::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--border-light);
    transition: all 0.3s ease;
}

.progress-step.active {
    color: #f97316;
    border-color: rgba(249, 115, 22, 0.3);
    background: linear-gradient(135deg, #fff7ed, #ffffff);
    font-weight: 600;
}

.progress-step.active::before {
    background: linear-gradient(180deg, #f97316, #fbbf24);
    animation: progressPulse 1.5s ease-in-out infinite;
}

.progress-step.completed {
    color: #22c55e;
    border-color: rgba(34, 197, 94, 0.3);
}

.progress-step.completed::before {
    background: #22c55e;
}

.progress-step i {
    font-size: 1rem;
}

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

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

/* Loading Steps */
.loading-steps {
    display: flex;
    gap: 2rem;
    margin-top: 1rem;
}

.loading-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.85rem;
    transition: all 0.3s ease;
    position: relative;
}

.loading-step.active {
    color: #f97316;
}

.loading-step.completed {
    color: #22c55e;
}

.loading-step i {
    font-size: 1rem;
}

.loading-step.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #f97316, #fbbf24);
    border-radius: 2px;
    animation: loadingProgress 2s ease-in-out infinite;
}

@keyframes loadingProgress {
    0%, 100% { transform: scaleX(0); transform-origin: left; }
    50% { transform: scaleX(1); transform-origin: left; }
}

/* Chat Bubbles */
.chat-container {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    height: 600px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.chat-input-area {
    padding: 1.5rem;
    border-top: 1px solid var(--border-light);
    background: var(--bg-surface-alt);
}

.message {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.message.user { flex-direction: row-reverse; }

.message-bubble {
    padding: 1rem 1.5rem;
    border-radius: 1rem;
    max-width: 70%;
    line-height: 1.5;
    box-shadow: var(--shadow-sm);
}

.message.user .message-bubble {
    background: linear-gradient(135deg, var(--primary) 0%, #f59e0b 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.message.ai .message-bubble {
    background: white;
    color: var(--text-body);
    border-bottom-left-radius: 4px;
    border: 1px solid var(--border-light);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

/* =========================
   RESPONSIVE – TABLET (≤1024px)
   ========================= */
@media (max-width: 1024px) {
    :root { --header-height: 64px; }
    .container { padding: 0 1rem; }
    h1 { font-size: 2.75rem; }
    h2 { font-size: 1.75rem; }
    .hero { padding: 4rem 0 3rem; }
    .hero-title { font-size: 3.5rem; }
    .hero h1 { font-size: 3rem; }
    .subtitle { font-size: 1.15rem; }
    .footer-content { grid-template-columns: 1fr 1fr; gap: 2rem; }
    .grid-2 { grid-template-columns: 1fr; }
    .inline-loading { flex-direction: column; text-align: center; gap: 1rem; }
    .loading-progress { flex-wrap: wrap; }
    .logo img { height: 40px; }
    /* Tablette : on garde les libellés (plus lisibles que des icônes seules) */
    .nav-link i { display: none; }
    .nav-link { padding: 0.5rem 0.85rem; font-size: 0.875rem; }
    .nav-user-btn > span { display: none; }
    .nav-user-btn { padding: 0.4rem 0.6rem; }
}

/* =========================
   RESPONSIVE – MOBILE (≤768px)
   ========================= */
@media (max-width: 768px) {
    :root { --header-height: 56px; }
    main { padding: 1.5rem 0; }

    /* Navigation : hamburger + panneau déroulant */
    .nav-center,
    .nav-actions { display: none; }
    .nav-toggle { display: inline-flex; margin-right: -0.5rem; }
    .logo img { height: 36px; }

    .nav-mobile-menu:not([hidden]) {
        display: flex;
        flex-direction: column;
        gap: 2px;
        position: absolute;
        top: 100%;
        left: -1rem;
        right: -1rem;
        margin-top: calc((var(--header-height) - 44px) / 2);
        background: #fff;
        border-bottom: 1px solid var(--border-light);
        box-shadow: 0 16px 32px rgba(15, 23, 42, 0.14);
        padding: 0.75rem 1rem 1rem;
        max-height: calc(100vh - var(--header-height) - 4px);
        max-height: calc(100dvh - var(--header-height) - 4px);
        overflow-y: auto;
        z-index: 1000;
        opacity: 0;
        transform: translateY(-10px);
        transition: opacity 0.2s ease, transform 0.2s ease;
    }
    .nav-mobile-menu.is-open { opacity: 1; transform: none; }

    .nav-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1000;
        background: rgba(15, 23, 42, 0.35);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
    }
    .nav-backdrop.is-open { opacity: 1; pointer-events: auto; }
    body.nav-open { overflow: hidden; }

    /* Typography */
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.2rem; }

    /* Hero */
    .hero { padding: 2.5rem 0 2rem; }
    .hero-title { font-size: 2.5rem; }
    .hero h1 { font-size: 2.25rem; }
    .subtitle { font-size: 1rem; max-width: 100%; }
    .hero-description { font-size: 0.95rem; }
    .hero-badge { font-size: 0.75rem; padding: 0.4rem 0.8rem; }
    .floating-icon { display: none; }
    .hero-bg-elements { display: none; }

    /* Search */
    .search-container { padding: 0 0.5rem; }
    #query-input { padding-right: 1rem; font-size: 1rem; height: 50px; }
    .search-container button[type="submit"] {
        position: static;
        width: 100%;
        margin-top: 0.5rem;
        padding: 0.75rem 1rem;
    }
    .search-container .input-group { flex-direction: column; }
    .examples { gap: 0.5rem; }
    .btn-example { font-size: 0.8rem; padding: 0.5rem 1rem; }

    /* Footer */
    .footer-content { grid-template-columns: 1fr; gap: 2rem; }
    footer { padding: 2.5rem 0 0; }
    .footer-title { margin-bottom: 0.6rem; }
    .footer-bottom .container { flex-direction: column; }
    .footer-bottom { font-size: 0.78rem; padding: 1.25rem 0; }

    /* Grids */
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }

    /* Cards */
    .card { padding: 1.25rem; }

    /* Chat */
    .chat-container { height: calc(100vh - var(--header-height) - 120px); min-height: 400px; }
    .chat-messages { padding: 1rem; }
    .chat-input-area { padding: 1rem; }
    .message-bubble { max-width: 88%; }

    /* Loading */
    .inline-loading { flex-direction: column; text-align: center; padding: 1.5rem 1rem; gap: 1rem; }
    .loading-progress { flex-direction: column; gap: 0.5rem; }
    .loading-steps { flex-direction: column; gap: 0.75rem; }

}

/* =========================
   RESPONSIVE – SMALL PHONE (≤480px)
   ========================= */
@media (max-width: 480px) {
    .container { padding: 0 0.75rem; }
    h1 { font-size: 1.6rem; }
    .hero-title { font-size: 1.8rem; }
    .hero h1 { font-size: 1.7rem; }
    .subtitle { font-size: 0.9rem; }
    .btn { padding: 0.6rem 1rem; font-size: 0.9rem; }
    .card { padding: 1rem; }
    .stat-counter { font-size: 2rem; }
    .autocomplete-container { max-height: 250px; }
    .footer-content { gap: 1.5rem; }
    .nav-mobile-menu:not([hidden]) { left: -0.75rem; right: -0.75rem; }
}

@media (min-width: 481px) and (max-width: 768px) {
    .footer-content { grid-template-columns: 1fr 1fr; }
    .footer-brand { grid-column: 1 / -1; }
}

footer :focus-visible { outline-color: #fb923c; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* =========================
   UTILITIES (a11y)
   ========================= */
.sr-only {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0);
    white-space: nowrap; border: 0;
}

/* =========================
   ABOUT PAGE (.ab-*)
   ========================= */
.ab { padding-bottom: 4rem; }
main:has(.ab) { padding-top: 0; }
.ab section[id] { scroll-margin-top: calc(var(--header-height) + 1.5rem); }

.ab-hero {
    background:
        radial-gradient(800px 320px at 85% -10%, rgba(22, 163, 74, 0.08), transparent 70%),
        radial-gradient(700px 320px at 0% 0%, rgba(249, 115, 22, 0.10), transparent 70%),
        var(--bg-surface);
    border-bottom: 1px solid var(--border-light);
    padding: 4rem 0 2rem;
    margin-bottom: 1rem;
}
.ab-eyebrow {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--primary-hover);
    background: var(--primary-light);
    border: 1px solid #fed7aa;
    border-radius: 999px;
    padding: 0.3rem 0.8rem;
    margin-bottom: 1.25rem;
}
.ab-title {
    font-size: clamp(2rem, 4.2vw, 3.1rem);
    letter-spacing: -0.03em;
    line-height: 1.1;
    max-width: 24ch;
    margin-bottom: 1.25rem;
}
.ab-lead {
    font-size: 1.12rem;
    line-height: 1.7;
    max-width: 68ch;
    color: var(--text-body);
    margin-bottom: 2rem;
}
.ab-facts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin: 0 0 2rem;
}
.ab-fact {
    background: var(--bg-body);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column-reverse;
    gap: 0.15rem;
}
.ab-fact dt { font-size: 0.85rem; color: var(--text-muted); }
.ab-fact dd {
    margin: 0;
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}
.ab-toc { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: flex-start; width: auto; }
.ab-toc a {
    font-size: 0.85rem;
    color: var(--text-body);
    border: 1px solid var(--border-light);
    background: var(--bg-surface);
    border-radius: 999px;
    padding: 0.35rem 0.85rem;
}
.ab-toc a:hover { border-color: var(--primary); color: var(--primary-hover); }

.ab-section { padding: 3rem 0 1rem; }
.ab-h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); margin-bottom: 1rem; }
.ab-h3 { font-size: 1.15rem; margin: 2rem 0 0.5rem; }
.ab-intro { max-width: 72ch; color: var(--text-body); margin-bottom: 1.5rem; }
.ab-intro code, .ab code {
    font-size: 0.88em;
    background: var(--bg-surface-alt);
    border: 1px solid var(--border-light);
    border-radius: 4px;
    padding: 0.05rem 0.35rem;
}
.ab-prose p { font-size: 1.05rem; line-height: 1.75; max-width: 68ch; }
.ab-mission {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    gap: 2rem;
}

.ab-grid { display: grid; gap: 1.25rem; }
.ab-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ab-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.ab-feature,
.ab-panel {
    display: flex;
    flex-direction: column;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    color: var(--text-body);
    font-weight: 400;
}
a.ab-feature { transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease; }
a.ab-feature:hover {
    border-color: rgba(249, 115, 22, 0.45);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
    color: var(--text-body);
}
.ab-feature h3, .ab-panel h3 { font-size: 1.08rem; margin-bottom: 0.5rem; }
.ab-feature p, .ab-panel p { font-size: 0.94rem; line-height: 1.65; margin-bottom: 0.75rem; }
.ab-panel p:last-child { margin-bottom: 0; }
.ab-panel h3 i { color: var(--primary); margin-right: 0.35rem; }
.ab-feature-icon {
    width: 42px; height: 42px;
    border-radius: 12px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--primary-light);
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 1.05rem;
}
.ab-feature-soon .ab-feature-icon { background: var(--secondary-light); color: var(--secondary); }
.ab-feature-link {
    margin-top: auto;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-hover);
    display: inline-flex; align-items: center; gap: 0.4rem;
}
.ab-badge {
    display: inline-block;
    vertical-align: middle;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--secondary-hover);
    background: var(--secondary-light);
    border: 1px solid #bbf7d0;
    border-radius: 999px;
    padding: 0.1rem 0.5rem;
    margin-left: 0.25rem;
}

/* Étapes IA */
.ab-steps {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
    counter-reset: none;
    margin-bottom: 1.5rem;
}
.ab-step {
    position: relative;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}
.ab-step h3 { font-size: 1.05rem; margin-bottom: 0.4rem; }
.ab-step p { font-size: 0.94rem; margin: 0; line-height: 1.65; }
.ab-step-num {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--text-main);
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 0.85rem;
}
.ab-step:nth-child(2) .ab-step-num { background: var(--secondary); }
.ab-step:nth-child(3) .ab-step-num { background: var(--primary); }

.ab-callout {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: var(--radius-lg);
    padding: 1.5rem 1.75rem;
}
.ab-callout h3 { font-size: 1.05rem; margin-bottom: 0.75rem; color: #92400e; }
.ab-callout ul { margin: 0; padding-left: 1.2rem; display: grid; gap: 0.5rem; }
.ab-callout li { font-size: 0.94rem; line-height: 1.6; color: #44403c; }

/* Tableau des sources */
.ab-sources-summary { min-height: 1.6rem; color: var(--text-body); margin-bottom: 1rem; }
.ab-table-wrap {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.ab-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.ab-table th, .ab-table td {
    padding: 0.85rem 1.1rem;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--border-light);
}
.ab-table thead th {
    background: var(--bg-surface-alt);
    color: var(--text-muted);
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.ab-table tbody tr:last-child td { border-bottom: none; }
.ab-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ab-table a { font-weight: 500; }
.ab-licence { color: var(--text-muted); font-size: 0.85rem; }
.ab-fresh { display: inline-flex; align-items: center; gap: 0.45rem; flex-wrap: wrap; white-space: nowrap; }
.ab-dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; flex-shrink: 0; }
.ab-fresh.is-stale .ab-dot { background: #f59e0b; }
.ab-rel { color: var(--text-muted); font-size: 0.85em; }
.ab-empty { text-align: center; color: var(--text-muted); padding: 1.5rem !important; }
.ab-retry {
    margin-left: 0.5rem;
    background: none;
    border: 1px solid var(--border-hover);
    border-radius: 999px;
    padding: 0.2rem 0.75rem;
    cursor: pointer;
    color: var(--text-body);
    font: inherit;
}
.ab-skeleton {
    display: inline-block;
    height: 0.9rem;
    width: 100%;
    max-width: 100%;
    border-radius: 6px;
    background: linear-gradient(90deg, #eef2f7 0%, #f8fafc 50%, #eef2f7 100%);
    background-size: 200% 100%;
    animation: abShimmer 1.2s linear infinite;
    vertical-align: middle;
}
@keyframes abShimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* Auteur */
.ab-author {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
}
.ab-author-avatar {
    flex-shrink: 0;
    width: 72px; height: 72px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    font-size: 1.4rem;
    letter-spacing: 0.02em;
    color: #fff;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
}
.ab-author-body h3 { font-size: 1.25rem; margin-bottom: 0.25rem; }
.ab-author-role { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 0.75rem; }
.ab-author-links { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.ab-author-links .btn { font-size: 0.92rem; padding: 0.6rem 1.1rem; }

/* FAQ */
.ab-faq {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.ab-faq details + details { border-top: 1px solid var(--border-light); }
.ab-faq summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1.1rem 1.4rem;
    font-weight: 600;
    color: var(--text-main);
}
.ab-faq summary::-webkit-details-marker { display: none; }
.ab-faq summary::after {
    content: '';
    flex-shrink: 0;
    width: 9px; height: 9px;
    border-right: 2px solid var(--text-muted);
    border-bottom: 2px solid var(--text-muted);
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.2s ease;
}
.ab-faq details[open] summary::after { transform: rotate(-135deg) translateY(-2px); }
.ab-faq summary:hover { background: var(--bg-body); }
.ab-faq summary:focus-visible { outline-offset: -3px; }
.ab-faq details > div { padding: 0 1.4rem 1.2rem; }
.ab-faq details[open] > div { animation: abFaqIn 0.2s ease-out; }
.ab-faq details p { margin: 0; color: var(--text-body); line-height: 1.7; max-width: 75ch; }
@keyframes abFaqIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* CTA */
.ab-cta {
    margin-top: 3rem;
    text-align: center;
    border-radius: var(--radius-xl);
    padding: 2.75rem 1.5rem;
    color: #fff;
    background: linear-gradient(135deg, #ea580c 0%, #f97316 55%, #16a34a 140%);
}
.ab-cta h2 { color: #fff; font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: 0.5rem; }
.ab-cta p { color: rgba(255, 255, 255, 0.92); margin-bottom: 1.5rem; }
.ab-cta-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; }
.ab-btn-light { background: #fff; color: var(--primary-hover); }
.ab-btn-light:hover { background: #fff7ed; color: var(--primary-hover); }
.ab-btn-ghost { background: rgba(255, 255, 255, 0.14); color: #fff; border: 1px solid rgba(255, 255, 255, 0.5); }
.ab-btn-ghost:hover { background: rgba(255, 255, 255, 0.24); color: #fff; }
.ab-cta :focus-visible { outline-color: #fff; }

@media (max-width: 1024px) {
    .ab-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ab-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
    .ab-hero { padding: 2.5rem 0 1.5rem; }
    .ab-mission { grid-template-columns: 1fr; gap: 0; }
    .ab-grid-2, .ab-grid-3, .ab-steps { grid-template-columns: 1fr; }
    .ab-section { padding-top: 2.25rem; }
    .ab-fact dd { font-size: 1.3rem; }
    .ab-title br { display: none; }
    .ab-author { flex-direction: column; gap: 1rem; padding: 1.25rem; }
    .ab-author-avatar { width: 56px; height: 56px; font-size: 1.1rem; }
    .ab-callout { padding: 1.25rem; }
    .ab-faq summary { padding: 1rem 1.1rem; }
    .ab-faq details > div { padding: 0 1.1rem 1rem; }

    /* Tableaux -> cartes empilées */
    .ab-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
    .ab-table, .ab-table tbody, .ab-table tr, .ab-table td { display: block; width: 100%; }
    .ab-table tr { padding: 0.75rem 1rem; border-bottom: 1px solid var(--border-light); }
    .ab-table tbody tr:last-child { border-bottom: none; }
    .ab-table td { border: none; padding: 0.2rem 0; text-align: left; }
    .ab-table .num { text-align: left; }
    .ab-table td[data-label]::before {
        content: attr(data-label);
        display: block;
        font-size: 0.72rem;
        font-weight: 600;
        letter-spacing: 0.05em;
        text-transform: uppercase;
        color: var(--text-muted);
    }
    .ab-table td[data-label="Source"]::before,
    .ab-table td[data-label="Producteur"]::before { display: none; }
    .ab-table td[data-label="Source"],
    .ab-table td[data-label="Producteur"] { font-weight: 600; padding-bottom: 0.35rem; }
    .ab-table td[data-label="Séries"],
    .ab-table td[data-label="Dernière collecte"] { display: inline-block; width: auto; margin-right: 1.5rem; }
}

/* =========================
   THEMATIC EXPLORER (.th-*) — /sectors/
   ========================= */
.th { padding-bottom: 4rem; }
main:has(.th) { padding-top: 0; }
.th-hero {
    background:
        radial-gradient(700px 300px at 100% 0%, rgba(22, 163, 74, 0.07), transparent 70%),
        radial-gradient(700px 300px at 0% 0%, rgba(249, 115, 22, 0.09), transparent 70%),
        var(--bg-surface);
    border-bottom: 1px solid var(--border-light);
    padding: 3.25rem 0 2rem;
    margin-bottom: 2rem;
}
.th-title { font-size: clamp(1.8rem, 3.6vw, 2.6rem); letter-spacing: -0.03em; margin-bottom: 0.75rem; }
.th-lead { font-size: 1.08rem; line-height: 1.7; max-width: 68ch; color: var(--text-body); margin-bottom: 1rem; }
.th-hero-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin: 0; font-size: 0.92rem; }
.th-hero-links a { display: inline-flex; align-items: center; gap: 0.45rem; font-weight: 600; }

.th-grid {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
    gap: 1.25rem;
}
.th-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.4rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    animation: thIn 0.35s ease-out both;
}
.th-card:not(.is-empty):hover {
    border-color: rgba(249, 115, 22, 0.45);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}
.th-card:focus-within { border-color: var(--primary); }
@keyframes thIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.th-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.9rem; }
.th-card-icon {
    width: 42px; height: 42px;
    border-radius: 12px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 1.05rem;
    flex-shrink: 0;
}
.th-card-count {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}
.th-card-title { font-size: 1.12rem; margin-bottom: 0.4rem; }
.th-card-link { color: var(--text-main); font-weight: 700; }
.th-card-link::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }
.th-card-link:hover { color: var(--text-main); }
.th-card-link:focus-visible { outline: none; }
.th-card-link:focus-visible::after { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.th-card-desc { font-size: 0.92rem; line-height: 1.6; color: var(--text-body); margin-bottom: 0.9rem; }
.th-card-sources { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 1rem; }
.th-card-foot {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--border-light);
}
.th-card-cta { font-size: 0.88rem; font-weight: 600; color: var(--primary-hover); display: inline-flex; gap: 0.4rem; align-items: center; }
.th-card-dash {
    position: relative;
    z-index: 1;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-muted);
    display: inline-flex; align-items: center; gap: 0.35rem;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    border: 1px solid var(--border-light);
    background: var(--bg-surface);
}
.th-card-dash i { font-size: 0.7rem; }
.th-card-dash:hover { color: var(--secondary-hover); border-color: #86efac; background: var(--secondary-light); }
.th-card.is-empty { opacity: 0.75; }
.th-card.is-empty .th-card-icon { background: var(--bg-surface-alt); color: var(--text-muted); }

.th-chip {
    display: inline-flex;
    align-items: center;
    font-size: 0.74rem;
    font-weight: 500;
    line-height: 1.4;
    padding: 0.12rem 0.55rem;
    border-radius: 999px;
    background: var(--bg-surface-alt);
    color: var(--text-body);
    border: 1px solid var(--border-light);
    white-space: nowrap;
}
.th-src-wb { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }
.th-src-imf { background: #f0fdfa; border-color: #99f6e4; color: #0f766e; }
.th-src-un { background: #f0f9ff; border-color: #bae6fd; color: #0369a1; }
.th-src-oecd { background: #f5f3ff; border-color: #ddd6fe; color: #6d28d9; }
.th-src-unesco { background: #fdf2f8; border-color: #fbcfe8; color: #be185d; }
.th-src-ilo { background: #fefce8; border-color: #fde68a; color: #a16207; }
.th-src-national { background: var(--primary-light); border-color: #fed7aa; color: #c2410c; }

.th-note {
    margin-top: 2rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    max-width: 80ch;
}
.th-note i { color: var(--primary); margin-right: 0.25rem; }

/* Détail d'une thématique */
.th-breadcrumb { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; font-size: 0.88rem; margin-bottom: 1.25rem; justify-content: flex-start; width: auto; }
.th-breadcrumb i { font-size: 0.65rem; color: var(--text-muted); }
.th-breadcrumb span { color: var(--text-muted); }
.th-detail-head { display: flex; gap: 1.1rem; align-items: flex-start; }
.th-detail-icon { width: 52px; height: 52px; font-size: 1.3rem; border-radius: 14px; margin-top: 0.2rem; }
.th-detail-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.5rem; margin-top: 0.5rem; }
.th-detail-count { margin: 0; color: var(--text-body); }
.th-detail-count strong { font-size: 1.35rem; color: var(--text-main); font-variant-numeric: tabular-nums; }
.th-dash-btn { font-size: 0.9rem; padding: 0.55rem 1rem; }

.th-toolbar { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.th-field { position: relative; flex: 1 1 220px; }
.th-field-search { flex: 2 1 320px; }
.th-field-search i { position: absolute; left: 0.95rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 0.9rem; pointer-events: none; }
.th-field input[type="search"] {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 2.5rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    color: var(--text-main);
    font-size: 1rem;
    font-family: inherit;
}
.th-field select { padding: 0.8rem 1rem; font-family: inherit; }
.th-results { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 0.75rem; min-height: 1.4rem; }

.th-list {
    list-style: none;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.th-list:empty { display: none; }
.th-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.5rem 1rem;
    align-items: center;
    padding: 0.95rem 1.2rem;
    border-bottom: 1px solid var(--border-light);
}
.th-item:last-child { border-bottom: none; }
.th-item.is-open { background: #fffdfa; }
.th-item-name { font-size: 0.98rem; font-weight: 600; line-height: 1.4; margin: 0 0 0.3rem; color: var(--text-main); }
.th-item-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.6rem; margin: 0; font-size: 0.8rem; color: var(--text-muted); }
.th-item-meta code {
    font-size: 0.78rem;
    color: var(--text-body);
    background: var(--bg-surface-alt);
    border-radius: 4px;
    padding: 0.05rem 0.35rem;
    overflow-wrap: anywhere;
}
.th-item-unit { overflow-wrap: anywhere; }
.th-item-toggle {
    display: inline-flex; align-items: center; gap: 0.45rem;
    font: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-hover);
    background: var(--primary-light);
    border: 1px solid #fed7aa;
    border-radius: 999px;
    padding: 0.4rem 0.9rem;
    cursor: pointer;
    white-space: nowrap;
}
.th-item-toggle:hover { background: #ffedd5; }
.th-item-toggle i { font-size: 0.7rem; transition: transform 0.2s ease; }
.th-item-toggle[aria-expanded="true"] i { transform: rotate(180deg); }
.th-panel { grid-column: 1 / -1; padding-top: 0.5rem; }
.th-panel-state { font-size: 0.9rem; color: var(--text-muted); padding: 0.75rem 0; }
.th-panel-state i { margin-right: 0.3rem; }
.th-panel-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 1.25rem; align-items: stretch; }
.th-kpi { display: flex; flex-direction: column; gap: 0.25rem; padding: 0.75rem 0; }
.th-kpi-label { font-size: 0.78rem; color: var(--text-muted); }
.th-kpi-value { font-size: 1.75rem; font-weight: 700; color: var(--text-main); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.th-kpi-unit { font-size: 0.82rem; color: var(--text-body); overflow-wrap: anywhere; }
.th-kpi-range { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.4rem; }
.th-kpi-proj { font-size: 0.78rem; color: var(--text-muted); display: inline-flex; align-items: center; gap: 0.4rem; }
.th-dash-sample { width: 22px; border-top: 2px dashed var(--primary); }
.th-chart { position: relative; height: 220px; min-width: 0; }
.th-panel-src { font-size: 0.8rem; color: var(--text-muted); margin: 0.5rem 0 0.25rem; overflow-wrap: anywhere; }
.th-more-wrap { text-align: center; margin-top: 1.25rem; }
.th-empty {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--text-muted);
    background: var(--bg-surface);
    border: 1px dashed var(--border-hover);
    border-radius: var(--radius-lg);
}
.th-empty i { font-size: 1.6rem; margin-bottom: 0.75rem; display: block; }
.th-empty p { margin: 0; }

@media (max-width: 768px) {
    .th-hero { padding: 2.25rem 0 1.5rem; margin-bottom: 1.25rem; }
    .th-detail-icon { width: 42px; height: 42px; font-size: 1.05rem; }
    .th-item { grid-template-columns: 1fr; padding: 0.9rem 1rem; }
    .th-item-toggle { justify-self: start; }
    .th-panel-grid { grid-template-columns: 1fr; gap: 0.25rem; }
    .th-chart { height: 200px; }
}

/* =========================
   AUTH & API KEY PAGES (.auth-*, .key-*)
   ========================= */
.auth {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
    padding: 3rem 1rem 4rem;
}
.auth-wide { max-width: 760px; }
.auth-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    box-shadow: 0 20px 40px -24px rgba(15, 23, 42, 0.25);
    padding: 2rem;
}
.auth-head { text-align: center; margin-bottom: 1.5rem; }
.auth-head-left { text-align: left; }
.auth-icon {
    width: 48px; height: 48px;
    border-radius: 14px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 1.15rem;
    margin-bottom: 1rem;
}
.auth-title { font-size: 1.65rem; letter-spacing: -0.02em; margin-bottom: 0.5rem; }
.auth-sub { color: var(--text-body); font-size: 0.95rem; line-height: 1.6; margin: 0; }
.auth-head-left .auth-sub { max-width: 60ch; }

.auth-google {
    display: flex; align-items: center; justify-content: center; gap: 0.6rem;
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-hover);
    border-radius: var(--radius-md);
    background: #fff;
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.95rem;
}
.auth-google:hover { background: var(--bg-body); border-color: #94a3b8; color: var(--text-main); }
.auth-sep {
    display: flex; align-items: center; gap: 0.75rem;
    margin: 1.25rem 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.auth-sep::before, .auth-sep::after { content: ''; flex: 1; height: 1px; background: var(--border-light); }

.auth-alert {
    display: flex; gap: 0.6rem;
    padding: 0.85rem 1rem;
    margin-bottom: 1.25rem;
    border-radius: var(--radius-md);
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    font-size: 0.9rem;
}
.auth-alert i { margin-top: 0.2rem; }
.auth-alert p { margin: 0; }
.auth-alert p + p { margin-top: 0.25rem; }

.auth-form { display: grid; gap: 1.1rem; }
.auth-field label { display: block; font-weight: 600; font-size: 0.88rem; color: var(--text-main); margin-bottom: 0.4rem; }
.auth-input,
.auth-field input:not([type="checkbox"]):not([type="hidden"]) {
    width: 100%;
    padding: 0.75rem 0.95rem;
    border: 1px solid var(--border-hover);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    color: var(--text-main);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.auth-input:focus,
.auth-field input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15); }
.auth-input[aria-invalid="true"],
.auth-field input[aria-invalid="true"] { border-color: #ef4444; }
.auth-hint { font-size: 0.8rem; color: var(--text-muted); margin: 0.35rem 0 0; }
.auth-error { font-size: 0.82rem; color: #b91c1c; margin: 0.35rem 0 0; }
.auth-check { display: flex; align-items: center; gap: 0.55rem; font-size: 0.9rem; color: var(--text-body); cursor: pointer; }
.auth-check input { width: 16px; height: 16px; accent-color: var(--primary); }
.auth-submit { width: 100%; padding: 0.85rem 1rem; font-size: 1rem; }
.auth-legal { font-size: 0.78rem; color: var(--text-muted); text-align: center; margin: 0; line-height: 1.5; }
.auth-foot {
    text-align: center;
    margin: 1.5rem 0 0;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-light);
    font-size: 0.92rem;
    color: var(--text-muted);
}
.auth-foot a { font-weight: 600; }
.auth-foot-left { text-align: left; border-top: none; padding-top: 0; }
.auth-note { text-align: center; font-size: 0.85rem; color: var(--text-muted); margin-top: 1.25rem; }
.auth-note i { margin-right: 0.3rem; }

/* Clé API */
.key-status {
    display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
}
.key-status.is-own { border-left-color: var(--secondary); }
.key-status-title { display: flex; align-items: center; gap: 0.55rem; font-size: 1.05rem; margin-bottom: 0.4rem; }
.key-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--primary); flex-shrink: 0; }
.key-status.is-own .key-dot { background: var(--secondary); }
.key-status-text { font-size: 0.9rem; color: var(--text-body); margin: 0; }
.key-status p { margin-bottom: 0.4rem; }
.key-code {
    font-size: 0.9rem;
    background: var(--secondary-light);
    border: 1px solid #bbf7d0;
    border-radius: 6px;
    padding: 0.3rem 0.6rem;
}
.key-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.key-actions .btn { font-size: 0.88rem; padding: 0.5rem 0.95rem; }
.key-danger { color: #b91c1c; border-color: #fecaca; }
.key-danger:hover { color: #991b1b; border-color: #f87171; background: #fef2f2; }

.key-setup, .key-faq { margin-bottom: 2rem; }
.key-h2 { font-size: 1.25rem; margin-bottom: 1rem; }
.key-steps {
    list-style: none;
    counter-reset: step;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.key-steps > li {
    counter-increment: step;
    position: relative;
    padding: 1.25rem 1.5rem 1.25rem 4.25rem;
    border-bottom: 1px solid var(--border-light);
}
.key-steps > li:last-child { border-bottom: none; }
.key-steps > li::before {
    content: counter(step);
    position: absolute;
    left: 1.5rem; top: 1.2rem;
    width: 30px; height: 30px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--text-main);
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
}
.key-steps > li:last-child::before { background: var(--primary); }
.key-steps h3 { font-size: 1rem; margin-bottom: 0.35rem; }
.key-steps p { font-size: 0.92rem; color: var(--text-body); margin-bottom: 0.75rem; }
.key-steps p:last-child { margin-bottom: 0; }
.key-steps code { font-size: 0.85em; background: var(--bg-surface-alt); border-radius: 4px; padding: 0.05rem 0.3rem; }
.key-ext { font-size: 0.88rem; padding: 0.5rem 0.95rem; }
.key-form { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.key-input { flex: 1 1 260px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.95rem; }
.key-form .btn { flex: 0 0 auto; }
.key-message { min-height: 1.2rem; font-size: 0.88rem; margin: 0.6rem 0 0 !important; }
.key-message.is-error { color: #b91c1c; }
.key-message.is-ok { color: var(--secondary-hover); }
.key-tip { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.85rem; }
.key-tip i { margin-right: 0.25rem; }

@media (max-width: 480px) {
    .auth { padding: 1.75rem 0.75rem 3rem; }
    .auth-card { padding: 1.4rem 1.1rem; border-radius: var(--radius-lg); }
    .auth-title { font-size: 1.4rem; }
    .key-steps > li { padding: 1.1rem 1rem 1.1rem 3.4rem; }
    .key-steps > li::before { left: 1rem; width: 26px; height: 26px; }
    .key-form .btn { width: 100%; }
    .key-status { padding: 1rem 1.1rem; }
}

/* Navigation à 5 entrées : on compacte avant que la barre ne déborde */
@media (max-width: 1240px) and (min-width: 769px) {
    .nav-link i { display: none; }
    .nav-link { padding: 0.5rem 0.75rem; font-size: 0.9rem; }
}
@media (max-width: 1024px) and (min-width: 769px) {
    .nav-link { padding: 0.45rem 0.55rem; font-size: 0.82rem; }
    .logo img { height: 34px; width: auto; }
    .nav-login-btn { padding: 0.45rem 0.8rem; font-size: 0.85rem; }
}
@media (max-width: 920px) and (min-width: 769px) {
    .nav-center .nav-link:first-child { display: none; }   /* le logo ramène déjà à l'accueil */
    .nav-login-btn i { display: none; }
}
