/* ============================================
   Jexcel.fr — Feuille de style principale
   Thème : gris sobre + accents vert Excel
   ============================================ */

:root {
    --green: #217346;
    --green-dark: #185a35;
    --green-light: #2da866;
    --green-soft: #e7f3ec;

    /* Couleurs des plages dans le tableur interactif (style Excel) */
    --range-0: #2E5BBA;
    --range-1: #C0504D;
    --range-2: #8064A2;
    --range-3: #E08214;
    --range-4: #1F8B8B;

    --gray-900: #1f2326;
    --gray-800: #2c3136;
    --gray-700: #3d444b;
    --gray-600: #5c6770;
    --gray-500: #828c95;
    --gray-400: #a8b1b8;
    --gray-300: #d2d7dc;
    --gray-200: #e5e8eb;
    --gray-100: #f1f3f5;
    --gray-50:  #f8f9fa;

    --white: #ffffff;
    --bg: #fafbfc;

    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 16px;

    --shadow-sm: 0 1px 2px rgba(15, 23, 28, 0.05);
    --shadow: 0 4px 12px rgba(15, 23, 28, 0.06);
    --shadow-lg: 0 12px 32px rgba(15, 23, 28, 0.10);

    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-mono: 'SF Mono', Menlo, Consolas, monospace;

    --transition: 180ms ease;
}

* { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    /* Fond vert sous la zone du status bar smartphone (notch / barre opérateur).
       Visible quand viewport-fit=cover laisse passer la safe-area. */
    background-color: var(--green);
}

body {
    margin: 0;
    font-family: var(--font);
    color: var(--gray-800);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    /* Au moins 4 px de padding pour réserver la place du liseré vert
       au-dessus du logo. Sur smartphone avec encoche / barre opérateur,
       la safe-area-inset-top vient agrandir la zone. */
    padding-top: 4px;
    padding-top: max(4px, env(safe-area-inset-top, 0px));
    position: relative;
}

/* Liseré vert Excel toujours visible au-dessus du logo (tous navigateurs).
   `position: fixed` garantit qu'il reste collé en haut au défilement.
   Hauteur = 4 px sur PC, ≥ safe-area sur smartphone (encoche / bandeau opérateur). */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    height: max(4px, env(safe-area-inset-top, 0px));
    background: var(--green);
    z-index: 9999;
    pointer-events: none;
}

/* ============================================================
   Banderole promo (site-wide, gérée depuis l'admin)
   ============================================================ */
.site-promo-banner {
    display: block;
    text-align: center;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-decoration: none;
    background: #c4961a;
    color: #fff;
    margin-top: 4px; /* sous le liseré vert fixe */
    box-shadow: inset 0 -1px 0 rgba(0,0,0,.08);
    line-height: 1.4;
    transition: filter .2s;
}
.site-promo-banner:hover { filter: brightness(1.06); color: inherit; }
@media (max-width: 600px) {
    .site-promo-banner { font-size: 13px; padding: 9px 16px; }
}

img { max-width: 100%; display: block; }

a { color: var(--green); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--green-dark); }

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* TOP 10 filter chip — visuel orange/vert pour se distinguer des catégories */
.filter-chip.filter-top10 {
    background: linear-gradient(90deg, #fff5e6 0%, #ffe1b3 100%);
    border-color: #e08214;
    color: #8a4f00;
    font-weight: 600;
}
.filter-chip.filter-top10.active {
    background: linear-gradient(90deg, #e08214 0%, #c46a00 100%);
    color: #fff;
    border-color: #c46a00;
}

/* ============================================ HEADER */
.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    /* Décale le header sous le liseré vert pour éviter qu'il soit
       partiellement masqué quand l'utilisateur défile la page. */
    top: 4px;
    top: max(4px, env(safe-area-inset-top, 0px));
    z-index: 100;
    backdrop-filter: blur(8px);
    background-color: rgba(255, 255, 255, 0.92);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

/* Logo : image SVG (J'excel.fr) qui remplace l'ancien wordmark texte.
   Le HTML existant (spans .logo-mark / .logo-apos / .logo-tld) est conservé
   mais masqué : on ne touche pas aux 36 pages. */
.logo {
    display: inline-block;
    width: 150px;
    height: 44px;
    background: url("../logo.svg") no-repeat center / contain;
    text-indent: -9999px;
    overflow: hidden;
    white-space: nowrap;
    font-size: 0;
    line-height: 0;
    color: transparent;
    vertical-align: middle;
}
.logo > * { display: none; }
.site-footer .logo {
    background-image: url("../logo-light.svg");
}

.main-nav ul {
    list-style: none;
    margin: 0; padding: 0;
    display: flex;
    gap: 8px;
}
.main-nav a {
    display: block;
    padding: 10px 16px;
    color: var(--gray-700);
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}
.main-nav a:hover { background: var(--gray-100); color: var(--gray-900); }
.main-nav a.active {
    color: var(--green);
    background: var(--green-soft);
}

.nav-toggle {
    display: none;
    background: none; border: none;
    width: 44px; height: 44px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    padding: 0;
    /* Empêche le zoom au double-tap et les sélections de texte */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    user-select: none;
}
.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--gray-800);
    border-radius: 2px;
    transition: transform 220ms ease, opacity 180ms ease;
    transform-origin: center;
}
/* Animation hamburger → croix quand ouvert */
.nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================================ BUTTONS */
.btn {
    display: inline-block;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    line-height: 1.2;
    font-family: inherit;
}
.btn-primary {
    background: var(--green);
    color: var(--white);
    border-color: var(--green);
}
.btn-primary:hover {
    background: var(--green-dark);
    border-color: var(--green-dark);
    color: var(--white);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}
.btn-ghost {
    background: var(--white);
    color: var(--gray-800);
    border-color: var(--gray-300);
}
.btn-ghost:hover {
    border-color: var(--green);
    color: var(--green);
}
.btn-block { width: 100%; }

/* ============================================ HERO */
.hero {
    padding: 80px 0 64px;
    background: linear-gradient(180deg, var(--white) 0%, var(--bg) 100%);
}
.hero-inner {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 64px;
    align-items: center;
}
.hero h1 {
    font-size: clamp(2rem, 4vw, 3.25rem);
    line-height: 1.15;
    color: var(--gray-900);
    margin: 0 0 20px;
    letter-spacing: -0.025em;
    font-weight: 700;
}
.accent { color: var(--green); }
.lead {
    font-size: 18px;
    color: var(--gray-600);
    margin: 0 0 32px;
    max-width: 540px;
}
.hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* Mock visuel Excel */
.excel-mock {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    border: 1px solid var(--gray-200);
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    pointer-events: none;
}
.excel-toolbar {
    background: var(--green);
    height: 32px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    gap: 6px;
}
.excel-toolbar span {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
}
.excel-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    background: var(--gray-200);
    gap: 1px;
}
.excel-grid .cell {
    background: var(--white);
    padding: 12px 14px;
    font-size: 14px;
    color: var(--gray-700);
    font-family: var(--font-mono);
}
.excel-grid .head {
    background: var(--gray-100);
    font-weight: 600;
    color: var(--gray-800);
}
.excel-grid .formula {
    background: var(--green-soft);
    color: var(--green-dark);
    font-weight: 600;
}
.excel-grid .highlight {
    background: var(--green);
    color: var(--white);
    font-weight: 600;
}

/* ============================================ SECTIONS */
.section-title {
    font-size: clamp(1.6rem, 2.5vw, 2.2rem);
    color: var(--gray-900);
    margin: 0 0 12px;
    letter-spacing: -0.02em;
    font-weight: 700;
}
.section-sub {
    color: var(--gray-600);
    margin: 0 0 40px;
    font-size: 17px;
}

.features { padding: 80px 0; }

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-top: 40px;
}
.feature-card {
    background: var(--white);
    padding: 28px;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    transition: all var(--transition);
}
.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
    border-color: var(--green-light);
}
.feature-icon { font-size: 32px; margin-bottom: 12px; }
.feature-card h3 {
    margin: 0 0 8px;
    font-size: 18px;
    color: var(--gray-900);
}
.feature-card p {
    margin: 0 0 16px;
    color: var(--gray-600);
    font-size: 15px;
}
.card-link {
    font-weight: 600;
    font-size: 14px;
}

/* CTA Articles */
.articles-cta {
    padding: 60px 0;
}
.cta-box {
    background: linear-gradient(135deg, var(--gray-900) 0%, var(--gray-800) 100%);
    border-radius: var(--radius-lg);
    padding: 48px;
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 40px;
    align-items: center;
    color: var(--white);
    overflow: hidden;
    position: relative;
}
.cta-box::before {
    content: '';
    position: absolute;
    top: -40px; right: -40px;
    width: 200px; height: 200px;
    background: radial-gradient(circle, var(--green) 0%, transparent 70%);
    opacity: 0.4;
}
.cta-tag {
    display: inline-block;
    background: var(--green);
    color: var(--white);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 4px 12px;
    border-radius: 999px;
    margin-bottom: 14px;
}
.cta-text h2 {
    color: var(--white);
    font-size: clamp(1.4rem, 2.4vw, 1.9rem);
    margin: 0 0 14px;
    letter-spacing: -0.02em;
    line-height: 1.25;
}
.cta-text p {
    color: var(--gray-300);
    margin: 0 0 24px;
    font-size: 16px;
}
.cta-visual {
    position: relative;
    z-index: 1;
}
.cta-pile {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-end;
}
.cta-pill {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--rc);
    border: 1px solid var(--rc);
    border-radius: 999px;
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 700;
    backdrop-filter: blur(4px);
}

/* Pills (formules populaires) */
.popular { padding: 60px 0 100px; background: var(--white); border-top: 1px solid var(--gray-200); }
.pill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.pill {
    display: inline-block;
    padding: 8px 16px;
    background: var(--gray-100);
    color: var(--gray-800);
    border-radius: 999px;
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 600;
    border: 1px solid transparent;
    transition: all var(--transition);
}
.pill:hover {
    background: var(--green-soft);
    color: var(--green-dark);
    border-color: var(--green-light);
}

/* ============================================ PAGE HERO */
.page-hero {
    padding: 60px 0 40px;
    background: linear-gradient(180deg, var(--white) 0%, var(--bg) 100%);
    border-bottom: 1px solid var(--gray-200);
}
.page-hero h1 {
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    color: var(--gray-900);
    margin: 0 0 12px;
    letter-spacing: -0.02em;
}
.page-hero .lead { margin-bottom: 32px; }

/* ============================================ SEARCH */
.search-wrap { margin-bottom: 24px; max-width: 680px; }
.search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    transition: border-color var(--transition);
}
.search-box:focus-within {
    border-color: var(--green);
    box-shadow: 0 0 0 4px rgba(33, 115, 70, 0.1);
}
.search-icon {
    width: 20px; height: 20px;
    color: var(--gray-500);
    margin: 0 14px;
    flex-shrink: 0;
}
#formula-search,
.search-box input[type="search"] {
    flex: 1;
    border: none;
    outline: none;
    padding: 14px 0;
    font-size: 16px;
    background: transparent;
    font-family: inherit;
    color: var(--gray-900);
    min-width: 0;
}
.search-box input[type="search"]::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
}
.clear-btn {
    background: none;
    border: none;
    color: var(--gray-500);
    font-size: 24px;
    cursor: pointer;
    padding: 0 16px;
    line-height: 1;
    visibility: hidden;
}
.search-box.has-value .clear-btn { visibility: visible; }
.clear-btn:hover { color: var(--gray-900); }

.search-meta {
    margin-top: 10px;
    font-size: 13px;
    color: var(--gray-600);
    padding-left: 4px;
}

/* Filtres */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.filter-chip {
    background: var(--white);
    border: 1px solid var(--gray-300);
    color: var(--gray-700);
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
}
.filter-chip:hover { border-color: var(--green); color: var(--green); }
.filter-chip.active {
    background: var(--green);
    color: var(--white);
    border-color: var(--green);
}

/* ============================================ FORMULA LIST */
.formulas-list { padding: 48px 0 100px; }

.formula-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}
.formula-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 24px;
    transition: all var(--transition);
    display: block;
    color: inherit;
    position: relative;
}
.formula-top-badge {
    position: absolute;
    top: -10px;
    right: 12px;
    background: linear-gradient(135deg, #ff7e1f 0%, #ffb347 100%);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(255,100,0,.35);
    pointer-events: none;
    z-index: 1;
}
.formula-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--green-light);
    color: inherit;
}
.formula-card .category {
    display: inline-block;
    background: var(--green-soft);
    color: var(--green-dark);
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 4px;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}
.formula-card h3 {
    margin: 0 0 8px;
    font-family: var(--font-mono);
    font-size: 18px;
    color: var(--gray-900);
    font-weight: 700;
}
.formula-card p {
    margin: 0;
    color: var(--gray-600);
    font-size: 14px;
    line-height: 1.5;
}

.no-results {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-600);
}

/* ============================================ FORMULA PAGE */
.formula-page { padding: 40px 0 100px; }

.breadcrumbs {
    display: flex;
    gap: 8px;
    font-size: 14px;
    color: var(--gray-500);
    margin-bottom: 32px;
    flex-wrap: wrap;
}
.breadcrumbs a { color: var(--gray-600); }
.breadcrumbs a:hover { color: var(--green); }

.formula-header {
    background: var(--white);
    padding: 40px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    margin-bottom: 32px;
}
.formula-header .category {
    display: inline-block;
    background: var(--green-soft);
    color: var(--green-dark);
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 4px;
    letter-spacing: 0.05em;
    margin-bottom: 16px;
}
.formula-header h1 {
    font-family: var(--font-mono);
    font-size: clamp(2rem, 4vw, 2.75rem);
    margin: 0 0 12px;
    color: var(--gray-900);
    letter-spacing: -0.02em;
}

/* Sur les pages fichiers à télécharger (.has-ribbon = bandeau GRATUIT/PAYANT) :
   - titre plus modeste, en sans-serif pour mieux convenir à un nom de fichier
   - sous-titre légèrement réduit */
.formula-header.has-ribbon h1 {
    font-family: inherit;
    font-size: clamp(1.45rem, 2.6vw, 1.85rem);
    margin-bottom: 8px;
}
.formula-header.has-ribbon .formula-desc {
    font-size: 16px;
}
.formula-header .formula-desc {
    font-size: 18px;
    color: var(--gray-600);
    margin: 0;
}

.formula-section {
    background: var(--white);
    padding: 32px;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    margin-bottom: 24px;
}
.formula-section h2 {
    font-size: 20px;
    color: var(--gray-900);
    margin: 0 0 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.formula-section h2::before {
    content: "";
    display: block;
    width: 4px;
    height: 20px;
    background: var(--green);
    border-radius: 2px;
}

.syntax-box {
    background: var(--green-soft);
    color: var(--green-dark);
    padding: 18px 22px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 15px;
    overflow-x: auto;
    margin-bottom: 16px;
    border: 1px solid color-mix(in srgb, var(--green) 25%, transparent);
}
@supports not (background: color-mix(in srgb, red, blue)) {
    .syntax-box { border-color: rgba(33, 115, 70, 0.25); }
}
.syntax-box .syn-eq { color: var(--green); font-weight: 700; margin-right: 1px; }
.syntax-box .syn-fn { color: var(--green-dark); font-weight: 700; }
.syntax-box .syn-param {
    color: var(--pc);
    font-style: italic;
    font-weight: 600;
}
/* La coloration des arguments doit aussi s'appliquer partout (articles, exemples) */
.syn-param {
    color: var(--pc);
    font-weight: 700;
}
/* Dans le contexte d'un code monospace, garder italique */
pre .syn-param,
code .syn-param,
.example-code .syn-param,
.syntax-box .syn-param {
    font-style: italic;
}
/* Conservation des anciennes classes pour compatibilité */
.syntax-box .eq { color: var(--green); font-weight: 700; margin-right: 1px; }
.syntax-box .kw { color: var(--green-dark); font-weight: 700; }
.syntax-box .param { color: #8a5a00; font-style: italic; }

/* Nom d'argument coloré pour matcher la syntaxe au-dessus */
.arg-name {
    font-family: var(--font-mono);
    color: var(--pc, var(--green-dark));
    font-weight: 700;
    font-size: 14px;
}

.arg-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.arg-list li {
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-200);
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 16px;
}
.arg-list li:last-child { border-bottom: none; }
.arg-list .arg-name {
    font-family: var(--font-mono);
    color: var(--pc, var(--green-dark));
    font-weight: 700;
    font-size: 14px;
}
.arg-list .arg-name .optional {
    color: var(--gray-500);
    font-weight: 400;
    font-style: italic;
    margin-left: 4px;
}
.arg-list .arg-desc {
    color: var(--gray-700);
    font-size: 14px;
}

.example {
    background: var(--gray-50);
    border-left: 4px solid var(--green);
    padding: 20px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin-bottom: 16px;
}
.example:last-child { margin-bottom: 0; }
.example h4 {
    margin: 0 0 10px;
    font-size: 15px;
    color: var(--gray-900);
}
.example code, .inline-code {
    display: inline-block;
    background: var(--white);
    padding: 4px 10px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--green-dark);
    border: 1px solid var(--gray-200);
}
/* Code des exemples avec coloration des plages */
.example-code {
    display: inline-block;
    position: relative;
    background: var(--white);
    padding: 6px 10px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--gray-900);
    border: 1px solid var(--gray-200);
    line-height: 1.7;
    max-width: 100%;
    overflow-x: auto;
    white-space: nowrap;
}
.example-code .ss-fn-locked {
    color: var(--gray-900);
    font-weight: 700;
    background: transparent;
    padding: 0;
    cursor: default;
}
.example-code .ss-range-tag {
    display: inline-block;
    color: var(--rc);
    font-weight: 700;
    padding: 0 4px;
    border-radius: 3px;
    background: color-mix(in srgb, var(--rc) 12%, transparent);
}
@supports not (background: color-mix(in srgb, red, blue)) {
    .example-code .ss-range-tag { background: rgba(46, 91, 186, 0.12); }
}
.example p { margin: 8px 0 0; color: var(--gray-700); font-size: 14px; }

.use-case {
    padding: 16px 0;
    border-bottom: 1px solid var(--gray-200);
}
.use-case:last-child { border-bottom: none; padding-bottom: 0; }
.use-case h4 {
    margin: 0 0 6px;
    color: var(--gray-900);
    font-size: 15px;
}
.use-case p {
    margin: 0;
    color: var(--gray-700);
    font-size: 14px;
}

.tip-box {
    background: var(--green-soft);
    border-left: 4px solid var(--green);
    padding: 16px 20px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin: 8px 0;
}
.tip-box strong { color: var(--green-dark); }
.tip-box p { margin: 6px 0 0; color: var(--gray-800); font-size: 14px; }

.related-formulas {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.not-found { text-align: center; padding: 80px 20px; }

/* ============================================ ALTERNATIVES (fiche formule) */
.alt-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.alt-item {
    padding: 16px 0;
    border-bottom: 1px solid var(--gray-200);
}
.alt-item:last-child { border-bottom: none; }
.alt-item h4 {
    margin: 0 0 8px;
    color: var(--gray-900);
    font-size: 15px;
}
.alt-item .example-code,
.alt-item .inline-code {
    margin-bottom: 8px;
}
.alt-item p {
    margin: 6px 0 0;
    color: var(--gray-700);
    font-size: 14px;
    line-height: 1.55;
}

/* ============================================ TABLEUR INTERACTIF */
.spreadsheet {
    background: var(--white);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
/* Espacement quand le tableur est intégré au corps d'un article */
.article-body .article-demo-host { margin: 24px 0; }

/* ── Démo « liste déroulante dépendante » (article dédié) ── */
.dep-demo {
    margin: 24px 0;
    padding: 20px 22px;
    background: var(--green-soft, #eaf5ef);
    border: 1px solid #b0d9c0;
    border-radius: 10px;
}
.dep-demo-controls {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.dep-demo-field { flex: 1 1 220px; display: flex; flex-direction: column; gap: 4px; }
.dep-demo-field > span {
    font-size: 12px;
    font-weight: 700;
    color: var(--green-dark, #185a35);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.dep-demo-field input,
.dep-demo-field select {
    padding: 10px 12px;
    border: 1px solid #b0d9c0;
    border-radius: 8px;
    background: #fff;
    font: inherit;
    font-size: 15px;
    color: var(--gray-900, #1c2227);
    box-sizing: border-box;
    width: 100%;
}
.dep-demo-field input:focus,
.dep-demo-field select:focus {
    outline: 2px solid var(--green, #217346);
    outline-offset: -1px;
    border-color: var(--green, #217346);
}
.dep-demo-field select:disabled {
    background: #f3f5f7;
    color: var(--gray-500, #828c95);
    cursor: not-allowed;
}
.dep-demo-status {
    margin: 12px 0 0;
    font-size: 13px;
    font-weight: 500;
}
.dep-demo-status.ok   { color: var(--green-dark, #185a35); }
.dep-demo-status.warn { color: #9a5c00; }

.dep-demo-source {
    margin-top: 14px;
    background: #fff;
    border: 1px solid #cfe0d6;
    border-radius: 8px;
    padding: 10px 14px;
}
.dep-demo-source summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--green-dark, #185a35);
    font-size: 14px;
    list-style: none;
}
.dep-demo-source summary::-webkit-details-marker { display: none; }
.dep-demo-source[open] summary { margin-bottom: 8px; }
.dep-demo-source table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    margin-top: 4px;
}
.dep-demo-source th,
.dep-demo-source td {
    padding: 7px 10px;
    border: 1px solid var(--gray-200, #e5e8eb);
    text-align: left;
    vertical-align: top;
}
.dep-demo-source th {
    background: var(--green-soft, #eaf5ef);
    color: var(--green-dark, #185a35);
}
.article-body .article-demo-note {
    margin-top: -12px;
    margin-bottom: 24px;
    padding: 8px 14px;
    background: #f1f8f4;
    border-left: 3px solid var(--green, #217346);
    font-size: 0.92em;
    color: var(--gray-700, #4a5560);
    border-radius: 0 6px 6px 0;
}
.ss-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-50);
    flex-wrap: wrap;
}
.ss-head strong { color: var(--gray-900); font-size: 15px; }
.ss-intro {
    margin: 4px 0 0;
    color: var(--gray-600);
    font-size: 13px;
}
.ss-reset {
    background: var(--white);
    border: 1px solid var(--gray-300);
    color: var(--gray-700);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    transition: all var(--transition);
    flex-shrink: 0;
}
.ss-reset:hover { border-color: var(--green); color: var(--green); }

.ss-formula-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    font-family: var(--font-mono);
    font-size: 13px;
}
.ss-fx {
    font-style: italic;
    color: var(--gray-500);
    font-weight: 600;
    padding-right: 12px;
    border-right: 1px solid var(--gray-300);
}
.ss-formula-bar code {
    color: var(--green-dark);
    font-size: 13px;
    background: none;
    padding: 0;
    border: none;
}
.ss-formula-input {
    flex: 1;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--gray-900);
    white-space: nowrap;
    overflow-x: auto;
    line-height: 1.6;
    padding: 4px 10px;
    border: 1px solid transparent;
    border-radius: 4px;
    background: var(--white);
    min-height: 26px;
    transition: border-color var(--transition), box-shadow var(--transition);
    display: flex;
    align-items: center;
    gap: 0;
}
.ss-formula-input:hover { border-color: var(--gray-300); }
.ss-formula-input:focus-within {
    border-color: var(--green);
    box-shadow: 0 0 0 2px rgba(33,115,70,0.15);
}
.ss-args-editable {
    outline: none;
    cursor: text;
    min-width: 8px;
    padding: 0 2px;
    border-radius: 3px;
    background: rgba(33,115,70,0.04);
    transition: background var(--transition);
}
.ss-args-editable:hover { background: rgba(33,115,70,0.08); }
.ss-args-editable:focus { background: var(--white); box-shadow: inset 0 0 0 1px var(--green-light); }
.ss-inner-fn {
    color: var(--gray-700);
    font-weight: 700;
}
/* Nom de fonction : verrouillé (non éditable) */
.ss-fn-locked {
    display: inline-block;
    color: var(--gray-900);
    font-weight: 700;
    background: var(--gray-200);
    padding: 0 4px;
    border-radius: 3px;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    cursor: not-allowed;
}
.ss-fn-locked:hover {
    background: var(--gray-300);
}

/* Tag visuel des plages (coloré, éditable au sein du parent contenteditable) */
.ss-range-tag {
    display: inline-block;
    color: var(--rc);
    font-weight: 700;
    padding: 0 4px;
    border-radius: 3px;
    background: color-mix(in srgb, var(--rc) 12%, transparent);
}
@supports not (background: color-mix(in srgb, red, blue)) {
    .ss-range-tag { background: rgba(46, 91, 186, 0.12); }
}

.ss-scroll {
    overflow-x: auto;
    background: var(--gray-100);
    /* Masquer la scrollbar par défaut (le tableau auto-fit) — tout en
       gardant la possibilité de scroller par molette/touch si jamais. */
    scrollbar-width: none;          /* Firefox */
    -ms-overflow-style: none;       /* IE/Edge legacy */
}
.ss-scroll::-webkit-scrollbar {
    display: none;                  /* Chrome / Safari */
    width: 0; height: 0;
}
.ss-table-wrap {
    position: relative;
    display: inline-block;
    min-width: 100%;
}
.ss-table {
    border-collapse: collapse;
    width: 100%;
    min-width: 320px;
    background: var(--white);
    font-size: 14px;
}
.ss-table th, .ss-table td {
    border: 1px solid var(--gray-200);
    padding: 8px 12px;
    text-align: left;
    min-width: 80px;
    height: 32px;
    color: var(--gray-800);
}
.ss-table thead th {
    background: var(--gray-100);
    color: var(--gray-600);
    font-weight: 600;
    text-align: center;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    min-width: 80px;
}
.ss-corner { width: 36px; min-width: 36px; }
.ss-rowhead {
    background: var(--gray-100);
    color: var(--gray-600);
    font-weight: 600;
    text-align: center;
    vertical-align: middle;
    /* Ultra-fin : juste assez pour les numéros 1 à 99 */
    width: 28px;
    min-width: 28px;
    max-width: 32px;
    padding: 2px 4px;
    font-size: 11px;
    position: relative;
    user-select: none;
}
.ss-corner { width: 28px; min-width: 28px; max-width: 32px; }
.ss-table thead th { position: relative; user-select: none; vertical-align: middle; }
/* Tableau adaptatif : largeurs auto basées sur le contenu */
.ss-table { table-layout: auto; }
.ss-table td { min-width: 70px; }
/* Poignées de redimensionnement (style Excel) */
.ss-col-resize {
    position: absolute;
    top: 0;
    right: -3px;
    width: 6px;
    height: 100%;
    cursor: col-resize;
    z-index: 6;
}
.ss-col-resize:hover { background: var(--green); opacity: 0.5; }
.ss-row-resize {
    position: absolute;
    left: 0;
    bottom: -3px;
    width: 100%;
    height: 6px;
    cursor: row-resize;
    z-index: 6;
}
.ss-row-resize:hover { background: var(--green); opacity: 0.5; }
.ss-thead {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-900);
}
.ss-readonly {
    background: var(--white);
    color: var(--gray-700);
}
.ss-editable {
    background: #f0faf3;
    cursor: text;
    outline: none;
    transition: background var(--transition);
    position: relative;
}
.ss-editable::before {
    content: '';
    position: absolute;
    top: 2px; right: 2px;
    width: 6px; height: 6px;
    border-top: 2px solid var(--green-light);
    border-right: 2px solid var(--green-light);
    opacity: 0.4;
}
.ss-editable:hover { background: #e0f3e7; }
.ss-editable:focus {
    background: var(--white);
    box-shadow: inset 0 0 0 2px var(--green);
    z-index: 2;
}

.ss-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    background: var(--green);
    color: var(--white);
}
.ss-result-label {
    font-size: 14px;
    font-weight: 500;
    opacity: 0.95;
}
.ss-result-value {
    font-family: var(--font-mono);
    font-size: 18px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.15);
    padding: 4px 14px;
    border-radius: var(--radius-sm);
    text-align: right;
}
.ss-result-value.ss-error { background: rgba(255, 100, 100, 0.3); }

/* Overlay des plages sur la grille */
.ss-range-overlay {
    position: absolute;
    pointer-events: none;
    border: 2px solid;
    border-radius: 3px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.5);
    z-index: 5;
    box-sizing: border-box;
}
/* Bords déplaçables (style "drag move" Excel) */
.ss-range-move {
    position: absolute;
    pointer-events: auto;
    cursor: move;
    z-index: 6;
}
/* Pendant un drag, on rend les overlays transparents aux clics
   pour que elementFromPoint atteigne bien les cellules en dessous */
.ss-dragging .ss-range-overlay,
.ss-dragging .ss-range-move,
.ss-dragging .ss-range-handle {
    pointer-events: none !important;
}
.ss-range-move-top    { top: -4px; left: 0; right: 0; height: 8px; }
.ss-range-move-bottom { bottom: -4px; left: 0; right: 12px; height: 8px; }
.ss-range-move-left   { top: 0; left: -4px; bottom: 0; width: 8px; }
.ss-range-move-right  { top: 0; right: -4px; bottom: 12px; width: 8px; }
/* Poignée de redimensionnement (bas-droite) */
.ss-range-handle {
    position: absolute;
    right: -5px;
    bottom: -5px;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    border: 1.5px solid #fff;
    cursor: nwse-resize;
    pointer-events: auto;
    z-index: 7;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.15);
}
.ss-range-handle:hover { transform: scale(1.3); }

.ss-hint {
    margin: 0;
    padding: 10px 20px;
    background: var(--gray-50);
    color: var(--gray-600);
    font-size: 12px;
    border-top: 1px solid var(--gray-200);
}

/* ============================================ RACCOURCIS CLAVIER */
.shortcuts-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.shortcuts-list li {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 20px;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--gray-200);
}
.shortcuts-list li:last-child { border-bottom: none; }
.kbd-combo {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--gray-600);
}
.shortcuts-list kbd {
    display: inline-block;
    background: var(--white);
    border: 1px solid var(--gray-300);
    border-bottom-width: 2px;
    color: var(--gray-900);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    box-shadow: 0 1px 0 var(--gray-200);
    line-height: 1.4;
}
.shortcut-desc {
    color: var(--gray-700);
    font-size: 14px;
}

/* ============================================ FAQ (page tutoriels) */
.faq-section {
    padding: 60px 0;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
}
/* FAQ search-wrap : reprend exactement le style .search-wrap / .search-box du site */
.faq-search-wrap {
    margin-bottom: 24px;
}
.faq-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 10px;
    flex-wrap: wrap;
}
.faq-count {
    font-size: 13px;
    color: var(--gray-600);
}
.faq-count #faq-count { font-weight: 700; color: var(--green-dark); }
.faq-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
/* Garantir que l'attribut hidden l'emporte sur display:grid */
.faq-list[hidden] { display: none; }
.faq-toggle-btn {
    padding: 10px 18px;
    font-size: 14px;
}
.faq-formula-link, .faq-tuto-link {
    color: var(--green-dark);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: var(--green-light);
    text-underline-offset: 2px;
}
/* Conteneur bas-droite pour "En savoir plus" dans les FAQ items */
.faq-item-actions {
    display: flex;
    justify-content: flex-end;
    padding: 0 18px 14px;
}

.faq-tuto-link {
    display: inline-block;
    margin-left: 0;
    padding: 2px 10px;
    background: var(--green-soft);
    border: 1px solid var(--green-light);
    border-radius: 999px;
    font-size: 12px;
    text-decoration: none;
    white-space: nowrap;
}
.faq-tuto-link:hover {
    background: var(--green);
    color: #fff;
}
@media (max-width: 800px) {
    .faq-list { grid-template-columns: 1fr; }
}
.faq-item {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    transition: border-color var(--transition), background var(--transition);
}
.faq-item[open] {
    background: var(--white);
    border-color: var(--green-light);
}
.faq-item summary {
    padding: 14px 18px;
    font-weight: 600;
    color: var(--gray-900);
    cursor: pointer;
    list-style: none;
    font-size: 14px;
    line-height: 1.4;
    position: relative;
    padding-right: 40px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: "+";
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    color: var(--green);
    font-weight: 400;
    transition: transform var(--transition);
}
.faq-item[open] summary::after {
    content: "−";
}
.faq-item summary:hover { color: var(--green-dark); }
.faq-item p {
    padding: 0 18px 16px;
    margin: 0;
    color: var(--gray-700);
    font-size: 14px;
    line-height: 1.6;
}
.faq-item p code,
.faq-item p kbd {
    font-size: 13px;
}
.faq-item p kbd {
    background: var(--white);
    border: 1px solid var(--gray-300);
    border-bottom-width: 2px;
    color: var(--gray-900);
    font-family: var(--font-mono);
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 3px;
    box-shadow: 0 1px 0 var(--gray-200);
}
.faq-empty {
    text-align: center;
    padding: 32px;
    color: var(--gray-600);
    font-style: italic;
}

/* ============================================ ARTICLES */
.articles-section {
    padding: 60px 0;
    background: var(--white);
    border-top: 1px solid var(--gray-200);
}
/* Contrôles de la liste des tutoriels : laisse respirer avant la grille */
.article-controls {
    margin-bottom: 36px;
}
.article-controls .search-wrap {
    max-width: 680px;
    margin: 0 0 18px;
}
.article-controls .filters {
    margin: 0;
}

/* ── Filtres 3 axes (Niveau / Sujet / Métier) ── */
.article-filter-groups {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 4px;
}
.filter-group {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex-wrap: wrap;
}
.filter-group-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gray-500, #828c95);
    padding-top: 9px;
    min-width: 54px;
    flex-shrink: 0;
}
.filter-group .filters { flex: 1; }

/* ── Badges de catégorie sur les cartes articles ── */

/* ── Badges sur les cartes : sélecteurs combinés (spécificité 0,2,0)
      pour dépasser la règle de base .article-cat (0,1,0)
      quelle que soit la position dans la feuille de style ── */

/* Niveau — Débutant : bleu ardoise */
.article-cat.article-cat--level {
    background: #e8f0fb; color: #2E5BBA; border: 1px solid #b8cef5;
}
/* Niveau — Intermédiaire : orange doux */
.article-cat.article-cat--intermediaire {
    background: #fef3e7; color: #9a5c00; border: 1px solid #f0cc96;
}
/* Niveau — Avancé : bordeaux foncé */
.article-cat.article-cat--avance {
    background: #f9eaf0; color: #8b1a4a; border: 1px solid #e0aac4;
}
/* Sujet — vert Excel */
.article-cat.article-cat--subject {
    background: var(--green-soft, #eaf5ef);
    color: var(--green-dark, #185a35);
    border: 1px solid #b0d9c0;
}
/* Métier — violet/lilas */
.article-cat.article-cat--metier {
    background: #f3eefa;
    color: #6b30b8;
    border: 1px solid #cdb5e8;
}

/* ── Chips de filtre = même couleur que les badges des cartes ──────────── */

/* Niveau — Débutant (bleu) */
#filter-level .filter-chip[data-level="Débutant"] {
    background: #e8f0fb; color: #2E5BBA; border-color: #b8cef5;
}
#filter-level .filter-chip[data-level="Débutant"]:hover,
#filter-level .filter-chip[data-level="Débutant"].active {
    background: #2E5BBA; color: #fff; border-color: #2E5BBA;
}

/* Niveau — Intermédiaire (orange) */
#filter-level .filter-chip[data-level="Intermédiaire"] {
    background: #fef3e7; color: #9a5c00; border-color: #f0cc96;
}
#filter-level .filter-chip[data-level="Intermédiaire"]:hover,
#filter-level .filter-chip[data-level="Intermédiaire"].active {
    background: #9a5c00; color: #fff; border-color: #9a5c00;
}

/* Niveau — Avancé (bordeaux) */
#filter-level .filter-chip[data-level="Avancé"] {
    background: #f9eaf0; color: #8b1a4a; border-color: #e0aac4;
}
#filter-level .filter-chip[data-level="Avancé"]:hover,
#filter-level .filter-chip[data-level="Avancé"].active {
    background: #8b1a4a; color: #fff; border-color: #8b1a4a;
}

/* Sujet — vert (toutes les chips de sujet) */
#filter-subject .filter-chip:not([data-subject="all"]) {
    background: var(--green-soft, #eaf5ef);
    color: var(--green-dark, #185a35);
    border-color: #b0d9c0;
}
#filter-subject .filter-chip:not([data-subject="all"]):hover,
#filter-subject .filter-chip:not([data-subject="all"]).active {
    background: var(--green, #217346);
    color: #fff;
    border-color: var(--green, #217346);
}

/* Métier — violet (toutes les chips de métier) */
#filter-metier .filter-chip:not([data-metier="all"]) {
    background: #f3eefa; color: #6b30b8; border-color: #cdb5e8;
}
#filter-metier .filter-chip:not([data-metier="all"]):hover,
#filter-metier .filter-chip:not([data-metier="all"]).active {
    background: #6b30b8; color: #fff; border-color: #6b30b8;
}

/* Selects mobiles : cachés par défaut (desktop = chips) */
.filter-select { display: none; }

@media (max-width: 700px) {
    /* Cache les chips, affiche les selects */
    .article-filter-groups .filters { display: none; }
    .filter-select {
        display: block;
        width: 100%;
        padding: 9px 12px;
        border: 1px solid var(--gray-300, #d8dcdf);
        border-radius: 8px;
        background: #fff;
        font: inherit;
        font-size: 14px;
        color: var(--gray-800, #2d3338);
        appearance: none;
        -webkit-appearance: none;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23828c95' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 12px center;
        padding-right: 34px;
        cursor: pointer;
    }
    .filter-select:focus {
        outline: 2px solid var(--green, #217346);
        outline-offset: -1px;
        border-color: var(--green, #217346);
    }
    /* Réorganise le groupe en colonne sur mobile */
    .filter-group { flex-direction: column; gap: 6px; }
    .filter-group-label { padding-top: 0; min-width: auto; }
}


/* Badge "Le mieux noté" */
.article-card { position: relative; }
.article-top-badge {
    position: absolute;
    top: -10px;
    right: 16px;
    background: linear-gradient(135deg, #ff7e1f 0%, #ffb347 100%);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 5px 12px;
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(255, 100, 0, 0.35);
    z-index: 2;
}

/* Carte épinglée — bordure verte, fond inchangé */
.article-card-pinned {
    border: 1px solid var(--green, #217346);
}
/* Badge « 📌 Épinglé » en haut-gauche, sobre (fond blanc, contour vert) */
.article-pinned-badge {
    position: absolute;
    top: -10px;
    left: 16px;
    background: #fff;
    color: var(--green-dark, #185a35);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 4px 10px;
    border: 1px solid var(--green, #217346);
    border-radius: 999px;
    z-index: 2;
}

/* Mini-affichage des votes sur la carte (géré par .article-card-footer) */
.vote-mini {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: var(--gray-600);
}
.vote-mini-up, .vote-mini-down {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Widget de vote complet (page article / formule) */
.vote-widget {
    margin: 40px 0 0;
    padding: 24px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.vote-question {
    font-weight: 600;
    color: var(--gray-900);
    margin-right: auto;
}
.vote-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--white);
    border: 2px solid var(--gray-300);
    border-radius: 999px;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-800);
    transition: all var(--transition);
}
.vote-btn:hover {
    border-color: var(--green);
    color: var(--green-dark);
    transform: translateY(-1px);
}
.vote-btn.voted:hover {
    /* Indique visuellement qu'un re-clic annule */
    box-shadow: 0 0 0 2px rgba(33, 115, 70, 0.15);
}
.vote-btn.voted {
    background: var(--green-soft);
    border-color: var(--green);
    color: var(--green-dark);
}
.vote-btn.vote-down.voted {
    background: #fff3e6;
    border-color: #e08214;
    color: #8a4d00;
}
.vote-count {
    font-weight: 700;
    color: var(--gray-900);
    min-width: 18px;
    text-align: center;
}
.vote-btn.voted .vote-count { color: inherit; }
.vote-thanks {
    width: 100%;
    text-align: center;
    color: var(--green-dark);
    font-size: 13px;
    font-style: italic;
    margin-top: 6px;
}
.articles-section .section-title { margin-bottom: 8px; }
.articles-section .section-sub { margin-bottom: 36px; }
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 22px;
}
.article-card {
    display: block;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 26px;
    color: inherit;
    transition: all var(--transition);
}
.article-card:hover {
    border-color: var(--green-light);
    transform: translateY(-3px);
    box-shadow: var(--shadow);
    color: inherit;
}
/* Conteneur de badges (peut en avoir plusieurs) */
.article-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 12px;
}
.article-cat {
    display: inline-block;
    background: var(--green-soft);
    color: var(--green-dark);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 3px 9px;
    border-radius: 999px; /* pilule — identique aux chips de filtre */
    border: 1px solid transparent; /* chaque variante fournit sa couleur de bordure */
    /* margin-bottom géré par le wrapper .article-cats */
}
.article-card h3 {
    margin: 0 0 10px;
    font-size: 17px;
    color: var(--gray-900);
    line-height: 1.35;
}
.article-card p {
    margin: 0 0 14px;
    color: var(--gray-600);
    font-size: 14px;
    line-height: 1.55;
}
.article-meta {
    color: var(--gray-500);
    font-size: 12px;
}

/* Footer bas de carte : tags à gauche, votes à droite */
.article-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}
/* Les tags dans le footer n'ont pas besoin de margin-bottom */
.article-card-footer .article-cats {
    margin-bottom: 0;
}
.article-card-footer .vote-mini {
    margin: 0;
    flex-shrink: 0;
}

/* ============================================================
   BARRE DE PROGRESSION DE LECTURE
   ============================================================ */
.reading-progress-bar {
    position: fixed;
    top: 4px; /* posée juste sous le liseré vert (4 px) */
    top: max(4px, env(safe-area-inset-top, 4px));
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #5fa67e 0%, #a3d2b8 100%);
    z-index: 9998; /* sous le liseré vert (9999) */
    transition: width 0.12s linear;
    border-radius: 0 2px 2px 0;
    pointer-events: none;
    box-shadow: 0 1px 4px rgba(33,115,70,.25);
}

/* Toast de félicitation — version visible */
.read-congrats-toast {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%) translateY(32px) scale(0.88);
    background: linear-gradient(135deg, #185a35 0%, #217346 60%, #2a8f5a 100%);
    color: #fff;
    padding: 18px 32px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 16px 48px rgba(0,0,0,.32), 0 2px 8px rgba(33,115,70,.4);
    opacity: 0;
    transition: opacity .4s cubic-bezier(.22,1,.36,1), transform .4s cubic-bezier(.22,1,.36,1);
    z-index: 10000;
    pointer-events: none;
}
.read-congrats-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
}
.read-congrats-icon {
    font-size: 26px;
    line-height: 1;
    animation: congrats-bounce .6s ease infinite alternate;
    display: inline-block;
}
/* Les deux icônes rebondissent en décalé */
.read-congrats-toast .read-congrats-icon:last-child {
    animation-delay: .3s;
}
@keyframes congrats-bounce {
    from { transform: translateY(0) rotate(-8deg); }
    to   { transform: translateY(-6px) rotate(8deg); }
}
.read-congrats-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    text-align: center;
}
.read-congrats-text strong {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.read-congrats-text span {
    font-size: 13px;
    opacity: .85;
}

/* Toast — version mobile compacte */
@media (max-width: 600px) {
    .read-congrats-toast {
        padding: 16px 24px;
        gap: 10px;
        bottom: 24px;
        border-radius: 12px;
        /* Largeur ajustée — marges de 28 px de chaque côté */
        left: 28px;
        right: 28px;
        transform: translateY(32px) scale(0.88);
        /* Annule le centrage par left:50%/translateX du desktop */
        width: auto;
        max-width: none;
    }
    .read-congrats-toast.visible {
        transform: translateY(0) scale(1);
    }
    /* Supprime le second emoji sur mobile */
    .read-congrats-toast .read-congrats-icon:last-child {
        display: none;
    }
    .read-congrats-icon { font-size: 22px; }
    .read-congrats-text strong { font-size: 16px; }
    /* Masque la seconde ligne sur mobile */
    .read-congrats-text span { display: none; }
}

/* Canvas confettis — par-dessus tout, plein écran */
.read-confetti-canvas {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 9998;
}

/* CTA téléchargement (page fichier) */
.download-cta {
    background: var(--green-soft);
    border-color: var(--green-light);
}
.download-cta .btn-primary { font-size: 16px; padding: 14px 28px; }

/* Groupe de boutons : Télécharger + Accès complet */
.dl-btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
}
.dl-btn-sep {
    width: 1px;
    height: 32px;
    background: var(--gray-300, #d8dcdf);
    margin: 0 4px;
}
.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 26px;
    background: #fff;
    color: var(--green-dark, #185a35);
    border: 2px solid var(--green, #217346);
    border-radius: 999px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    font-family: inherit;
    transition: all .15s ease;
    text-decoration: none;
}
.btn-secondary:hover {
    background: var(--green, #217346);
    color: #fff;
    transform: translateY(-1px);
}

/* Screenshots & PDFs dans l'article du fichier */
.dl-screenshots {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin: 16px 0;
}
.dl-screenshots figure {
    margin: 0;
    background: #fff;
    border: 1px solid var(--gray-200, #e5e8eb);
    border-radius: 10px;
    padding: 12px;
    box-shadow: var(--shadow-sm);
}
.dl-screenshots img {
    width: 100%;
    height: auto;
    border-radius: 6px;
    display: block;
}
.dl-screenshots figcaption {
    margin-top: 8px;
    font-size: 13px;
    color: var(--gray-600, #5c6770);
    text-align: center;
    font-style: italic;
}

/* Curseur "loupe" sur les images cliquables des téléchargements
   pour signaler qu'on peut les agrandir au clic (lightbox). */
.dl-screenshots figure img,
.article-body .dl-screenshots figure img {
    cursor: zoom-in;
    transition: transform .15s ease;
}
.dl-screenshots figure img:hover,
.article-body .dl-screenshots figure img:hover {
    transform: scale(1.02);
}

/* ── Lightbox — overlay noir + image centrée plein écran ── */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .88);
    z-index: 10100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    cursor: zoom-out;
    opacity: 0;
    transition: opacity .2s ease;
}
.lightbox-overlay.visible { opacity: 1; }
.lightbox-overlay img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
    box-shadow: 0 16px 60px rgba(0, 0, 0, .6);
    transform: scale(.95);
    transition: transform .25s cubic-bezier(.22, 1, .36, 1);
}
.lightbox-overlay.visible img { transform: scale(1); }
.lightbox-close {
    position: absolute;
    top: 16px;
    right: 18px;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    border: 0;
    width: 42px;
    height: 42px;
    font-size: 22px;
    line-height: 1;
    border-radius: 50%;
    cursor: pointer;
    font-family: inherit;
    transition: background .15s ease;
}
.lightbox-close:hover { background: rgba(255, 255, 255, .25); }
.dl-pdf-list {
    list-style: none;
    padding: 0;
    margin: 12px 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 8px;
}
.dl-pdf-list li {
    background: var(--gray-50, #f8fafa);
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    padding: 0;
}
.dl-pdf-list a {
    display: block;
    padding: 10px 14px;
    color: var(--green-dark, #185a35);
    font-weight: 500;
    text-decoration: none;
}
.dl-pdf-list a:hover {
    background: var(--green-soft, #eaf5ef);
}

/* ── WYSIWYG (toolbar + éditeur) ── */
.wy-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 6px 8px;
    background: #f8fafa;
    border: 1px solid var(--gray-300, #d8dcdf);
    border-radius: 6px 6px 0 0;
    border-bottom: 0;
    align-items: center;
}
.wy-toolbar button {
    background: #fff;
    border: 1px solid transparent;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    color: var(--gray-700, #4a5560);
    font-family: inherit;
    line-height: 1;
    min-width: 30px;
    transition: all .12s;
}
.wy-toolbar button:hover {
    border-color: var(--green, #217346);
    color: var(--green-dark, #185a35);
    background: var(--green-soft, #eaf5ef);
}
.wy-sep {
    width: 1px;
    height: 20px;
    background: var(--gray-300, #d8dcdf);
    margin: 0 4px;
}
.wy-editor {
    line-height: 1.6;
}
.wy-editor:focus { box-shadow: inset 0 0 0 2px var(--green, #217346); }
.wy-editor h2, .wy-editor h3 { color: var(--green-dark, #185a35); margin: 16px 0 8px; }
.wy-editor p { margin: 0 0 12px; }
.wy-editor ul, .wy-editor ol { margin: 8px 0 12px 24px; }
.wy-editor figure { margin: 14px 0; }
.wy-editor img { max-width: 100%; height: auto; }
.wy-editor a { color: var(--green, #217346); }

/* ── File picker modal ── */
.admin-picker-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 10001;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.admin-picker {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 640px;
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 80px rgba(0,0,0,.3);
}
.admin-picker header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200);
}
.admin-picker header h3 { margin: 0; color: var(--green-dark, #185a35); font-size: 1.05rem; }
.admin-picker-close {
    background: none; border: none; font-size: 20px;
    color: var(--gray-500); cursor: pointer; padding: 4px 8px; border-radius: 4px;
}
.admin-picker-close:hover { background: var(--gray-100); }
.admin-picker-search { padding: 12px 20px; border-bottom: 1px solid var(--gray-200); }
.admin-picker-search input {
    width: 100%; padding: 9px 12px;
    border: 1px solid var(--gray-300); border-radius: 6px;
    font: inherit; font-size: 14px; box-sizing: border-box;
}
.admin-picker-list {
    overflow-y: auto;
    flex: 1;
    padding: 0 20px;
}
.admin-picker-group { margin: 14px 0; }
.admin-picker-group h4 {
    margin: 0 0 6px;
    font-size: 12px;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.admin-picker-list ul { list-style: none; padding: 0; margin: 0; }
.admin-picker-list li {
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 2px;
    transition: background .12s;
}
.admin-picker-list li:hover { background: var(--green-soft, #eaf5ef); }
.admin-picker-name { font-weight: 600; color: var(--gray-900); }
.admin-picker-path { font-size: 11px; color: var(--gray-500); background: none; padding: 0; }
.admin-picker footer { padding: 14px 20px; border-top: 1px solid var(--gray-200); background: #f8fafa; border-radius: 0 0 12px 12px; }

/* Mini-toolbar dans le formulaire admin de téléchargement (legacy, à supprimer) */
.dl-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 8px 0 6px;
    padding: 6px 8px;
    background: #f8fafa;
    border: 1px solid var(--gray-200, #e5e8eb);
    border-radius: 6px 6px 0 0;
    border-bottom: 0;
}
.dl-toolbar .btn-link {
    padding: 5px 10px;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    background: #fff;
    color: var(--gray-700, #4a5560);
    font-family: inherit;
    transition: all .12s;
}
.dl-toolbar .btn-link:hover {
    border-color: var(--green, #217346);
    color: var(--green-dark, #185a35);
    background: var(--green-soft, #eaf5ef);
}
.dl-toolbar .btn-link code { background: none; padding: 0; font-size: 12px; }

/* ── Modal « Accès complet » ── */
.unlock-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(2px);
    animation: unlockFade .2s ease;
}
@keyframes unlockFade { from { opacity: 0; } to { opacity: 1; } }
.unlock-modal {
    background: #fff;
    border-radius: 14px;
    max-width: 520px;
    width: 100%;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding: 28px 28px 24px;
    box-shadow: 0 24px 80px rgba(0,0,0,.3);
    position: relative;
    animation: unlockPop .25s cubic-bezier(.22,1,.36,1);
}
@keyframes unlockPop { from { transform: translateY(20px) scale(.95); opacity: 0; } to { transform: none; opacity: 1; } }
.unlock-close {
    position: absolute;
    top: 14px; right: 14px;
    background: none;
    border: none;
    font-size: 22px;
    color: var(--gray-500, #828c95);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    font-family: inherit;
}
.unlock-close:hover { background: var(--gray-100, #f0f3f6); color: var(--gray-800, #2d3338); }
.unlock-modal h3 {
    margin: 0 0 14px;
    color: var(--green-dark, #185a35);
    font-size: 1.25rem;
}
.unlock-intro {
    color: var(--gray-700, #4a5560);
    line-height: 1.55;
    margin: 0 0 20px;
}
.unlock-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 18px;
}
.unlock-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border-radius: 10px;
    border: 1px solid var(--gray-300, #d8dcdf);
    background: #fff;
    text-decoration: none;
    color: var(--gray-900, #1c2227);
    transition: all .15s ease;
}
.unlock-btn:hover {
    border-color: var(--green, #217346);
    background: var(--green-soft, #eaf5ef);
    transform: translateY(-1px);
}
.unlock-btn-icon { font-size: 26px; line-height: 1; }
.unlock-btn-body { display: flex; flex-direction: column; gap: 2px; }
.unlock-btn-body strong { font-size: 14px; }
.unlock-btn-body small { font-size: 12px; color: var(--gray-600, #5c6770); }
.unlock-btn-stripe { border-color: #635bff; }
.unlock-btn-stripe:hover { background: #f4f3ff; border-color: #635bff; }
.unlock-btn-paypal { border-color: #003087; }
.unlock-btn-paypal:hover { background: #f0f4fa; border-color: #003087; }
.unlock-no-payment {
    padding: 14px;
    background: #fef4e7;
    border: 1px solid #f0cc96;
    border-radius: 8px;
    color: #7a5c0a;
    font-size: 14px;
    margin: 0;
}
.unlock-howto {
    font-size: 13px;
    color: var(--gray-600, #5c6770);
    margin: 0 0 14px;
    padding: 10px 14px;
    background: var(--gray-50, #f8fafa);
    border-left: 3px solid var(--green, #217346);
    border-radius: 0 6px 6px 0;
}
.unlock-already summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--green-dark, #185a35);
    font-size: 14px;
    padding: 8px 0;
}
.unlock-already p {
    font-size: 13px;
    color: var(--gray-700, #4a5560);
    margin: 4px 0 0;
    line-height: 1.55;
}
.unlock-contact {
    font-size: 13px;
    color: var(--gray-600, #5c6770);
    margin: 16px 0 0;
    padding-top: 14px;
    border-top: 1px solid var(--gray-200, #e5e8eb);
}

/* Page article individuelle */
.article-page { padding: 40px 0 80px; }
.article-body {
    max-width: 760px;
    background: var(--white);
    padding: 48px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    margin: 0 auto;
}
.article-body h1 {
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    margin: 0 0 12px;
    color: var(--gray-900);
    letter-spacing: -0.02em;
}
.article-body .article-lead {
    font-size: 18px;
    color: var(--gray-600);
    margin: 0 0 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--gray-200);
}
.article-body h2 {
    font-size: 22px;
    color: var(--gray-900);
    margin: 36px 0 14px;
    padding-left: 14px;
    border-left: 4px solid var(--green);
    line-height: 1.3;
}
.article-body h3 {
    font-size: 17px;
    color: var(--gray-900);
    margin: 24px 0 10px;
}
.article-body p {
    color: var(--gray-700);
    margin: 0 0 14px;
    line-height: 1.7;
}
.article-body ul, .article-body ol {
    color: var(--gray-700);
    padding-left: 24px;
    line-height: 1.7;
}
.article-body li { margin-bottom: 6px; }
.article-body code {
    background: var(--gray-100);
    color: var(--green-dark);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 14px;
}
.article-body pre {
    background: var(--green-soft);
    color: var(--green-dark);
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    border: 1px solid color-mix(in srgb, var(--green) 25%, transparent);
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.55;
    margin: 14px 0 22px;
    /* La formule s'enroule toujours sur plusieurs lignes si nécessaire.
       Pas de barre de défilement horizontale, la formule est toujours visible en entier. */
    white-space: pre-wrap;
    word-break: break-word;
    overflow-x: visible;
    overflow-y: visible;
    max-width: 100%;
    box-sizing: border-box;
    transition: box-shadow 180ms ease, background-color 180ms ease, border-color 180ms ease;
}
@supports not (border-color: color-mix(in srgb, red, blue)) {
    .article-body pre { border-color: rgba(33, 115, 70, 0.25); }
}
.article-body pre:hover {
    background: var(--white);
    box-shadow: 0 4px 12px rgba(15, 23, 28, 0.10);
    border-color: var(--green);
}

/* ── Bouton Copier la formule ──────────────────────────────── */
.copy-formula-btn {
    position: absolute;
    top: 50%;
    right: 4px;
    transform: translateY(-50%);
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 5px;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--gray-500);
    padding: 0;
    transition: background .15s, border-color .15s, color .15s;
    z-index: 2;
}
pre .copy-formula-btn {
    top: 8px;
    right: 8px;
    transform: none;
}
.copy-formula-btn svg { width: 13px; height: 13px; pointer-events: none; }
.copy-formula-btn:hover { background: var(--green-soft); border-color: var(--green); color: var(--green-dark); }
.copy-formula-btn.copied { background: var(--green); border-color: var(--green); color: #fff; }
.article-body pre code { background: none; color: inherit; padding: 0; border: none; }

/* Coloration des formules (utilisée dans exemples + articles) */
.fcol-fn,
.example-code .ss-fn-locked {
    color: var(--green-dark);
    font-weight: 700;
}
.example-code .ss-inner-fn,
.article-body pre .ss-inner-fn {
    color: var(--gray-700);
    font-weight: 700;
}
.fcol-annot { color: var(--gray-500); font-style: italic; }
code.fcol-inline {
    background: var(--green-soft);
    color: var(--green-dark);
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid color-mix(in srgb, var(--green) 25%, transparent);
}
@supports not (border-color: color-mix(in srgb, red, blue)) {
    code.fcol-inline { border-color: rgba(33,115,70,0.25); }
}
/* Réutilise les tags de plage colorés dans les pre/code */
.article-body pre .ss-range-tag,
.article-body code .ss-range-tag,
.example-code .ss-range-tag {
    display: inline-block;
    color: var(--rc);
    font-weight: 700;
    padding: 0 4px;
    border-radius: 3px;
    background: color-mix(in srgb, var(--rc) 12%, transparent);
}
@supports not (background: color-mix(in srgb, red, blue)) {
    .article-body pre .ss-range-tag,
    .article-body code .ss-range-tag,
    .example-code .ss-range-tag { background: rgba(46, 91, 186, 0.12); }
}
.article-body blockquote {
    background: var(--green-soft);
    border-left: 4px solid var(--green);
    margin: 18px 0;
    padding: 14px 18px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--gray-800);
    font-style: italic;
}
.article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 18px 0;
    font-size: 14px;
}
.article-body th, .article-body td {
    border: 1px solid var(--gray-200);
    padding: 10px 12px;
    text-align: left;
}
.article-body th {
    background: var(--gray-100);
    color: var(--gray-900);
    font-weight: 600;
}

/* ============================================ ARTICLE ENHANCEMENTS */

/* Bloc visuel à chaque h2 (effet section) */
.article-body h2 {
    background: var(--gray-50);
    padding: 12px 18px 12px 18px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin: 52px 0 20px;
}

/* Touches clavier style physique */
.article-body kbd {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px 3px;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    color: var(--gray-900);
    background: var(--white);
    border: 1px solid var(--gray-300);
    border-bottom-width: 3px;
    border-radius: 4px;
    box-shadow: 0 1px 0 var(--gray-400);
    white-space: nowrap;
    line-height: 1.6;
    vertical-align: baseline;
}

/* Listes numérotées stylisées (.styled-list) */
.article-body ol.styled-list {
    list-style: none;
    counter-reset: sl;
    padding-left: 0;
    margin: 18px 0 24px;
}
.article-body ol.styled-list > li {
    counter-increment: sl;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 14px 0;
    border-bottom: 1px solid var(--gray-100);
}
.article-body ol.styled-list > li:last-child { border-bottom: none; }
.article-body ol.styled-list > li::before {
    content: counter(sl);
    min-width: 30px;
    height: 30px;
    background: var(--green);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 2px;
}

/* Bloc raccourci (titre + touches + description) */
.shortcut-item {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    padding: 18px 0;
    border-bottom: 1px solid var(--gray-100);
}
.shortcut-item:last-of-type { border-bottom: none; }
.shortcut-keys {
    min-width: 130px;
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    align-items: center;
    justify-content: center;
    padding-top: 3px;
    flex-shrink: 0;
}
.shortcut-keys kbd { font-size: 11px; }
.shortcut-keys .sep {
    font-size: 13px;
    color: var(--gray-500);
    font-weight: 700;
}
.shortcut-body { flex: 1; min-width: 0; }
.shortcut-body h3 { margin: 0 0 6px; font-size: 15px; }
.shortcut-body p  { margin: 0; font-size: 14px; color: var(--gray-600); }
@media (max-width: 600px) {
    .shortcut-item { flex-direction: column; gap: 10px; }
    .shortcut-keys { justify-content: flex-start; min-width: unset; }
}

/* ============================================ DOWNLOADS */
.downloads { padding: 48px 0 100px; }

.download-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}
.download-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 24px;
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* Bandeau diagonal "GRATUIT" / "PAYANT" en coin haut-droit */
.has-ribbon { position: relative; overflow: hidden; }
.download-ribbon {
    position: absolute;
    top: 18px;
    right: -52px;
    width: 180px;
    transform: rotate(45deg);
    transform-origin: center;
    text-align: center;
    padding: 5px 0;
    font-family: var(--font);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.14em;
    color: #ffffff;
    box-shadow:
        0 2px 6px rgba(0, 0, 0, 0.18),
        inset 0 -1px 0 rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
    z-index: 5;
    pointer-events: none;
    user-select: none;
}
.download-ribbon.tier-gratuit {
    background: linear-gradient(135deg, var(--green-light) 0%, var(--green) 50%, var(--green-dark) 100%);
}
.download-ribbon.ribbon-soon {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 50%, #374151 100%);
    color: #fff;
}

/* Carte "Bientôt disponible" — grisée, cliquable mais sans CTA téléchargement */
.download-card.coming-soon {
    background: linear-gradient(180deg, #fafbfc 0%, #f1f3f5 100%);
}
.download-card.coming-soon .download-icon,
.download-card.coming-soon h3,
.download-card.coming-soon p,
.download-card.coming-soon .download-meta {
    filter: grayscale(100%);
    opacity: 0.7;
}
.download-card.coming-soon:hover {
    border-color: var(--gray-400);
    transform: none;
}
.download-card.coming-soon:hover .download-icon,
.download-card.coming-soon:hover h3,
.download-card.coming-soon:hover p {
    opacity: 0.85;
}
.card-link-soon {
    color: var(--gray-600) !important;
    font-weight: 600;
    background: var(--gray-200);
    padding: 6px 12px;
    border-radius: 6px;
    display: inline-block;
    margin-top: 8px;
}
.download-card.coming-soon:hover .card-link-soon {
    background: var(--gray-300);
    color: var(--gray-900) !important;
}

/* Bouton "Bientôt disponible" sur la page détail */
.btn-soon {
    background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
    color: #fff;
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: not-allowed;
    opacity: 0.85;
    box-shadow: var(--shadow-sm);
}
.btn-soon:hover {
    transform: none;
    opacity: 0.95;
}
.download-cta.soon {
    background: linear-gradient(180deg, #f8f9fa 0%, #f1f3f5 100%);
    border-left: 4px solid var(--gray-500);
}

.download-ribbon.tier-payant {
    background: linear-gradient(135deg,
        #b8860b 0%,
        #ffd700 25%,
        #fff3a0 50%,
        #ffd700 75%,
        #b8860b 100%);
    background-size: 200% 200%;
    color: #5a4500;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
    animation: ribbonShine 4s ease-in-out infinite;
}
@keyframes ribbonShine {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
/* Variante du bouton CTA quand le fichier est payant */
.btn.btn-paid {
    background: linear-gradient(135deg, #b8860b 0%, #ffc107 50%, #b8860b 100%);
    color: #3a2c00;
    border-color: #8b6508;
    font-weight: 700;
}
.btn.btn-paid:hover {
    background: linear-gradient(135deg, #a07509 0%, #f5b800 50%, #a07509 100%);
    color: #3a2c00;
    border-color: #6e5106;
}

/* Sur la page fichier.html, .formula-header doit accueillir le bandeau */
.formula-header.has-ribbon { overflow: hidden; }

.download-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
    border-color: var(--green-light);
}
.download-icon { font-size: 36px; margin-bottom: 12px; }
.download-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 12px;
    color: var(--gray-500);
}
.tag {
    background: var(--green-soft);
    color: var(--green-dark);
    padding: 3px 10px;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 11px;
}
.download-card h3 {
    margin: 4px 0 8px;
    font-size: 17px;
    color: var(--gray-900);
}
.download-card p {
    color: var(--gray-600);
    font-size: 14px;
    margin: 0 0 20px;
    flex: 1;
}

.info-box {
    background: var(--green-soft);
    border-left: 4px solid var(--green);
    padding: 16px 20px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--gray-800);
    font-size: 14px;
}
.info-box code {
    background: var(--white);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--green-dark);
}

/* ============================================ CONTACT */
.contact-section { padding: 48px 0 100px; }
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 48px;
    align-items: start;
}
.contact-info h2 {
    font-size: 22px;
    color: var(--gray-900);
    margin: 0 0 12px;
}
.contact-info p { color: var(--gray-600); margin-bottom: 28px; }

.contact-list {
    list-style: none;
    padding: 0;
    margin: 0 0 32px;
}
.contact-list li {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 14px 0;
    border-bottom: 1px solid var(--gray-200);
}
.contact-list li:last-child { border-bottom: none; }
.contact-icon { font-size: 22px; flex-shrink: 0; }
.contact-list strong {
    display: block;
    color: var(--gray-900);
    font-size: 14px;
    margin-bottom: 2px;
}
.contact-list a, .contact-list span { color: var(--gray-700); font-size: 14px; }
.contact-list a:hover { color: var(--green); }

.contact-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 24px;
}
.contact-card h3 { margin: 0 0 14px; font-size: 17px; color: var(--gray-900); }
.contact-card details {
    border-bottom: 1px solid var(--gray-200);
    padding: 10px 0;
}
.contact-card details:last-child { border-bottom: none; }
.contact-card summary {
    cursor: pointer;
    font-weight: 500;
    color: var(--gray-800);
    font-size: 14px;
    padding: 4px 0;
}
.contact-card summary:hover { color: var(--green); }
.contact-card details p {
    margin: 8px 0 0;
    color: var(--gray-600);
    font-size: 14px;
}

/* Formulaire */
.contact-form {
    background: var(--white);
    padding: 36px;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
}
.contact-form h2 { margin: 0 0 24px; font-size: 22px; color: var(--gray-900); }
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.field { margin-bottom: 18px; }
.field label {
    display: block;
    font-weight: 500;
    font-size: 14px;
    color: var(--gray-800);
    margin-bottom: 6px;
}
.req { color: var(--green); }
.field input,
.field select,
.field textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    background: var(--white);
    font-family: inherit;
    font-size: 15px;
    color: var(--gray-900);
    transition: all var(--transition);
}
.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(33, 115, 70, 0.12);
}
.field textarea { resize: vertical; min-height: 120px; }
.field.checkbox-field {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.field.checkbox-field input {
    width: auto;
    margin-top: 3px;
    accent-color: var(--green);
}
.field.checkbox-field label {
    margin: 0;
    font-weight: 400;
    color: var(--gray-700);
    font-size: 13px;
}

.form-feedback {
    margin-top: 18px;
    padding: 14px;
    background: var(--green-soft);
    color: var(--green-dark);
    border-radius: var(--radius-sm);
    font-size: 14px;
    border: 1px solid var(--green-light);
}

/* ============================================ FOOTER */
.site-footer {
    background: var(--gray-900);
    color: var(--gray-300);
    margin-top: 80px;
}
.footer-inner {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 48px;
    padding: 60px 24px 40px;
}
.site-footer .logo { color: var(--white); }
.footer-tag {
    color: var(--gray-400);
    margin: 12px 0 0;
    font-size: 14px;
    max-width: 280px;
}
.footer-links h4 {
    color: var(--white);
    margin: 0 0 16px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}
.footer-links a {
    display: block;
    color: var(--gray-400);
    padding: 5px 0;
    font-size: 14px;
}
.footer-links a:hover { color: var(--green-light); }
.footer-bottom {
    border-top: 1px solid var(--gray-700);
    padding: 20px 0;
    font-size: 13px;
    color: var(--gray-500);
}

/* ============================================ ADMIN */
.admin-badge {
    display: inline-block;
    background: var(--green);
    color: var(--white);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    padding: 4px 10px;
    border-radius: 4px;
    margin-left: 12px;
}
.admin-page { padding: 40px 0 80px; }
.admin-login {
    max-width: 420px;
    margin: 60px auto;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 40px;
}
.admin-login h1 { margin: 0 0 8px; }
.admin-login .lead { margin-bottom: 24px; font-size: 14px; color: var(--gray-600); }
.admin-login code {
    background: var(--gray-100);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: var(--font-mono);
    font-size: 13px;
}
.admin-shell {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 24px 28px;
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-50);
    flex-wrap: wrap;
}
.admin-header h1 { margin: 0 0 4px; font-size: 22px; }
.admin-sub { margin: 0; color: var(--gray-600); font-size: 13px; }
.admin-tabs {
    display: flex;
    background: var(--gray-100);
    border-bottom: 1px solid var(--gray-200);
    overflow-x: auto;
}
.admin-tabs button {
    background: none;
    border: none;
    padding: 14px 22px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-700);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}
.admin-tabs button:hover { color: var(--green); }
.admin-tabs button.active {
    color: var(--green);
    border-bottom-color: var(--green);
    background: var(--white);
}

/* Sélecteur d'onglet mobile (caché en desktop) */
.admin-tabs-mobile { display: none; }
.admin-tabs-mobile-label {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-600);
    margin-bottom: 6px;
    font-weight: 600;
}
.admin-tabs-mobile select {
    width: 100%;
    padding: 12px 14px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    color: var(--green-dark);
    border: 2px solid var(--green);
    border-radius: 8px;
    background: var(--white);
    cursor: pointer;
}

.admin-content { padding: 28px; min-height: 400px; }

/* ──────────────────────────────────────────────────────────
   Sidebar verticale gauche (nouvelle UI admin)
   ────────────────────────────────────────────────────────── */
.admin-shell-sidebar {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: calc(100vh - 100px);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.admin-sidebar {
    background: #1e2a35;
    color: #d8dee3;
    padding: 20px 0 80px;
    border-right: 1px solid #2a3744;
    overflow-y: auto;
    position: relative;
}
.admin-sidebar-brand {
    padding: 0 22px 18px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    color: #8a9bab;
    border-bottom: 1px solid #2a3744;
    margin-bottom: 14px;
}
.admin-sidebar-group { margin-bottom: 14px; }
.admin-sidebar-grouptitle {
    padding: 8px 22px 4px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #6b7c8c;
    font-weight: 600;
}
.admin-sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    background: none;
    border: none;
    color: #d8dee3;
    padding: 10px 22px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    border-left: 3px solid transparent;
    position: relative;
    transition: background .15s, color .15s;
}
.admin-sidebar-item .sb-icon { font-size: 16px; width: 20px; text-align: center; }
.admin-sidebar-item .sb-label { flex: 1; }
.admin-sidebar-item:hover { background: rgba(255,255,255,.04); color: #fff; }
.admin-sidebar-item.active {
    background: rgba(63, 168, 96, .15);
    color: #fff;
    border-left-color: var(--green);
}
.admin-sidebar-item .tab-badge {
    background: #c0392b;
    color: #fff;
    border-radius: 11px;
    padding: 1px 7px;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
}
.admin-sidebar-bottom {
    position: absolute;
    bottom: 14px;
    left: 0; right: 0;
    padding: 0 22px;
}
.admin-sidebar-bottom .btn { width: 100%; }
.admin-main { background: var(--white); display: flex; flex-direction: column; min-width: 0; }
.admin-header-slim {
    padding: 18px 28px;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}
.admin-header-slim h1 { font-size: 22px; margin: 0 0 4px; }
.admin-sidebar-toggle {
    display: none;
    position: fixed;
    top: 14px; right: 14px; /* à DROITE → le logo J'excel.fr reste visible à gauche */
    z-index: 200;
    background: var(--green);
    color: #fff;
    border: none;
    width: 42px; height: 42px;
    border-radius: 8px;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,.2);
}
.admin-sidebar-backdrop {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 40;
}
.admin-sidebar-backdrop.open { display: block; }
@media (max-width: 900px) {
    .admin-shell-sidebar { grid-template-columns: 1fr; }
    .admin-sidebar {
        position: fixed;
        top: 0; left: 0; bottom: 0;
        width: 260px;
        z-index: 50;
        transform: translateX(-100%);
        transition: transform .22s ease;
    }
    .admin-sidebar.open { transform: translateX(0); }
    .admin-sidebar-toggle { display: block; }
    /* Burger à droite → plus besoin de masquer le site-header.
       Le padding-right laisse de la place pour le burger. */
    .admin-header-slim { padding-right: 60px; }
}

/* ──────────────────────────────────────────────────────────
   Commentaires (frontend public) — design moderne
   ────────────────────────────────────────────────────────── */
/* ────────────────────────────────────────────────────────────────
   CHARTE GRAPHIQUE — éditeur de thème + prévisualisation
   ──────────────────────────────────────────────────────────────── */
.theme-editor {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 24px;
    margin-top: 20px;
}
.theme-controls fieldset {
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    padding: 14px 16px 10px;
    margin: 0 0 16px;
    background: var(--white);
}
.theme-controls legend {
    font-weight: 700;
    font-size: 13px;
    padding: 0 8px;
    color: var(--green-dark);
    letter-spacing: 0.02em;
}
.theme-field { display: block; margin: 0 0 10px; }
.theme-field-label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 5px;
}
.theme-field input[type="text"],
.theme-field select {
    width: 100%;
    padding: 8px 11px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    background: var(--white);
    font-family: inherit;
    font-size: 13px;
}
.theme-field input[type="range"] { width: 100%; accent-color: var(--green); }
.theme-field-color-row { display: flex; gap: 8px; align-items: center; }
.theme-field-color-row input[type="color"] {
    width: 40px; height: 36px;
    padding: 0;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    cursor: pointer;
    background: none;
    flex-shrink: 0;
}
.theme-field-color-row input[type="text"] {
    flex: 1;
    font-family: var(--font-mono);
    font-size: 12.5px;
}
.theme-range-value {
    color: var(--green-dark);
    font-weight: 600;
    font-size: 12px;
    margin-left: 6px;
}
.theme-actions {
    display: flex; gap: 10px; align-items: center;
    margin-top: 20px; flex-wrap: wrap;
}
.theme-preview {
    position: sticky;
    top: 16px;
    align-self: flex-start;
    max-height: calc(100vh - 40px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.theme-preview-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--gray-500);
    letter-spacing: 0.1em;
    margin-bottom: 8px;
}
.theme-preview-frame {
    flex: 1;
    overflow-y: auto;
    background: var(--bg);
    padding: 24px;
    border-radius: 12px;
    border: 1px solid var(--gray-200);
}
.preview-article {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 24px;
}
.preview-cat {
    display: inline-block;
    background: var(--green-soft);
    color: var(--green-dark);
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: var(--radius-sm);
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}
.preview-header h1 {
    font-size: 22px;
    margin: 0 0 6px;
    color: var(--gray-900);
    letter-spacing: -0.01em;
}
.preview-lead { color: var(--gray-600); font-size: 14px; margin: 0 0 16px; }
.preview-article h2 { font-size: 18px; color: var(--gray-900); margin: 16px 0 8px; }
.preview-article h3 { font-size: 15px; color: var(--gray-900); margin: 12px 0 6px; }
.preview-article h4 { font-size: 14px; color: var(--gray-900); margin: 0 0 4px; }
.preview-text { font-size: 14px; line-height: 1.5; color: var(--gray-800); }
.preview-article a { color: var(--green-dark); }
.preview-article code {
    background: var(--gray-100);
    padding: 1px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 12px;
}
.preview-article pre {
    background: var(--gray-100);
    border-left: 3px solid var(--green);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    font-size: 12.5px;
    margin: 12px 0;
}
.preview-article pre code { background: none; padding: 0; }
.preview-article ul { padding-left: 22px; margin: 8px 0 12px; font-size: 14px; }
.preview-buttons { display: flex; gap: 10px; margin: 14px 0; flex-wrap: wrap; }
.preview-btn-primary {
    background: var(--green);
    color: #fff;
    border: 1px solid var(--green);
    border-radius: var(--radius-sm);
    padding: 8px 18px;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 600;
    cursor: default;
}
.preview-btn-ghost {
    background: transparent;
    color: var(--green-dark);
    border: 1px solid var(--green);
    border-radius: var(--radius-sm);
    padding: 8px 18px;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 600;
    cursor: default;
}
.preview-card {
    border: 1px solid var(--gray-200);
    background: var(--white);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin: 14px 0;
}
.preview-comment {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    padding: 12px 14px;
    background: linear-gradient(90deg, rgba(33,115,70,.08) 0%, transparent 60%);
    border-left: 3px solid var(--green);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.preview-comment-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--white);
    border: 2px solid var(--green);
    color: var(--green-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 11px;
    flex-shrink: 0;
}
.preview-comment-badge {
    display: inline-block;
    background: var(--green);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
    letter-spacing: 0.05em;
    margin-left: 6px;
}
.preview-comment p {
    margin: 4px 0 0;
    font-size: 13px;
    color: var(--gray-700);
}
@media (max-width: 900px) {
    .theme-editor { grid-template-columns: 1fr; }
    .theme-preview { position: static; max-height: none; }
}

/* ════════════════════════════════════════════════════════════════
   COMMENTAIRES — design v2, intégré au flux (pas de carte cloisonnée)
   ════════════════════════════════════════════════════════════════ */
.comments-root-wrap {
    display: block;
    margin: 0 auto 60px;
    box-sizing: border-box;
    /* Le spacer DOM physique injecté par JS (height:64px) garantit l'écart au-dessus. */
}
.comments-root-wrap.comments-narrow { max-width: 760px; }

/* ── Conteneur global ──────────────────────────────────────── */
.jx-comments {
    color: var(--gray-900);
}

/* ── En-tête ──────────────────────────────────────────────── */
.jx-comments-head { margin-bottom: 28px; }
.jx-comments-head h2 {
    font-size: 26px;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 10px;
}
.jx-comments-dot {
    color: var(--green);
    font-size: 14px;
    line-height: 1;
}
.jx-comments-num {
    color: var(--gray-500, #9aa3ac);
    font-weight: 500;
    font-size: 18px;
    margin-left: 2px;
}
.jx-comments-sub {
    color: var(--gray-600);
    font-size: 14px;
    margin: 6px 0 0;
}

/* ── Composer (formulaire principal) ──────────────────────── */
.jx-c-form {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--gray-100, #eef0f3);
}
.jx-c-form-top {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}
.jx-c-form-top .jx-c-avatar { margin-top: 4px; }
.jx-c-form textarea {
    flex: 1;
    width: 100%;
    min-height: 56px;
    padding: 14px 16px;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    background: var(--gray-50, #f7f8fa);
    font-family: inherit;
    font-size: 15px;
    line-height: 1.55;
    color: var(--gray-900);
    resize: vertical;
    transition: background .18s, border-color .18s, box-shadow .18s, min-height .18s;
    box-sizing: border-box;
}
.jx-c-form.expanded textarea { min-height: 92px; background: var(--white); }
.jx-c-form textarea:focus {
    outline: none;
    background: var(--white);
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(63, 168, 96, .12);
}
.jx-c-form-bottom {
    display: none;
    margin-top: 12px;
    padding-left: 50px; /* aligne avec le textarea (sous l'avatar 36+14) */
    gap: 14px;
    align-items: center;
    flex-wrap: wrap;
}
.jx-c-form.expanded .jx-c-form-bottom { display: flex; }
.jx-c-form-fields {
    display: flex;
    gap: 8px;
    flex: 1;
    min-width: 220px;
}
.jx-c-form-fields input {
    flex: 1;
    min-width: 0;
    padding: 9px 13px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    background: var(--white);
    font-family: inherit;
    font-size: 13.5px;
    color: var(--gray-900);
    transition: border-color .15s, box-shadow .15s;
}
.jx-c-form-fields input:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(63, 168, 96, .12);
}
.jx-c-form-cta { display: flex; gap: 10px; align-items: center; }
.jx-c-form-msg { font-size: 13px; min-width: 0; }
.jx-c-form-msg.ok { color: var(--green-dark); font-weight: 600; }
.jx-c-form-msg.err { color: #c0392b; font-weight: 600; }
.jx-c-btn-primary {
    background: var(--green);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 9px 22px;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, transform .12s;
}
.jx-c-btn-primary:hover { background: var(--green-dark); }
.jx-c-btn-primary:active { transform: scale(.97); }
.jx-c-btn-primary:disabled { opacity: .55; cursor: not-allowed; }
.jx-c-btn-link {
    background: none;
    border: none;
    color: var(--gray-600);
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    padding: 6px 10px;
    border-radius: 6px;
}
.jx-c-btn-link:hover { color: var(--gray-900); background: var(--gray-100, #f1f3f5); }

/* ── Avatar ────────────────────────────────────────────────── */
.jx-c-avatar {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3fa860 0%, #185a35 100%);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.02em;
    line-height: 1;
}
.jx-c-avatar-empty {
    background: var(--gray-200);
    color: var(--gray-500, #9aa3ac);
    font-weight: 500;
}
.jx-c-avatar-admin {
    background: #fff;
    color: var(--green-dark);
    border: 2px solid var(--green);
    font-size: 11px;
}

/* ── Liste de commentaires ────────────────────────────────── */
.jx-comments-list {
    display: flex;
    flex-direction: column;
}
.jx-c-empty {
    color: var(--gray-500, #9aa3ac);
    font-style: italic;
    text-align: center;
    padding: 28px 0;
    margin: 0;
}

/* ── Item commentaire ─────────────────────────────────────── */
.jx-c {
    display: flex;
    gap: 14px;
    padding: 20px 0;
    border-top: 1px solid var(--gray-100, #eef0f3);
}
.jx-c:first-child { border-top: none; padding-top: 4px; }
.jx-c-admin {
    border-left: 3px solid var(--green);
    padding-left: 24px;  /* espace entre la ligne verte et le contenu */
    margin-left: -27px;  /* aligne le bord gauche de la ligne avec le conteneur */
    background: linear-gradient(90deg, rgba(63, 168, 96, .06) 0%, transparent 60%);
    border-radius: 0 8px 8px 0;
}
/* Le badge J'excel.fr est le premier élément de .jx-c-meta
   → on lui ajoute une marge gauche pour le décoller de la ligne verte */
.jx-c-admin .jx-c-meta { padding-left: 4px; }
.jx-c-admin .jx-c-body { padding-left: 4px; }
.jx-c-admin .jx-c-actions { padding-left: 4px; }
.jx-c-main { flex: 1; min-width: 0; }
.jx-c-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 13px;
    margin-bottom: 6px;
}
.jx-c-author {
    font-weight: 700;
    color: var(--gray-900);
    font-size: 14px;
}
.jx-c-sep { color: var(--gray-300, #d1d5db); }
.jx-c-date { color: var(--gray-500, #9aa3ac); }
.jx-c-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--green);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 0.05em;
}
.jx-c-badge svg { width: 10px; height: 10px; }
.jx-c-body {
    color: var(--gray-800, #2d3338);
    line-height: 1.6;
    font-size: 15px;
    white-space: pre-wrap;
    word-break: break-word;
    margin-bottom: 10px;
}

/* ── Actions sur un commentaire ────────────────────────────── */
.jx-c-actions {
    display: flex;
    gap: 4px;
    align-items: center;
    margin-left: -8px;
}
.jx-c-vote, .jx-c-reply {
    background: none;
    border: none;
    color: var(--gray-500, #9aa3ac);
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    padding: 6px 10px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: background .15s, color .15s;
}
.jx-c-vote:hover, .jx-c-reply:hover { background: var(--gray-100, #f1f3f5); color: var(--gray-900); }
.jx-c-vote svg { width: 16px; height: 16px; }
.jx-c-vote-n { font-variant-numeric: tabular-nums; min-width: 8px; }
.jx-c-vote.is-active { color: var(--green-dark); background: var(--green-soft); }
.jx-c-vote-useful.is-active { background: #d8f1e1; }
.jx-c-vote-down.is-active { color: #c0392b; background: #fce6e3; }
.jx-c-reply { font-weight: 600; color: var(--gray-700); margin-left: 4px; }

/* ── Formulaire de réponse (inline) ────────────────────────── */
.jx-c-reply-holder { margin-top: 10px; }
.jx-c-form-reply {
    margin: 8px 0 0;
    padding: 0;
    border: none;
}
.jx-c-form-reply textarea { min-height: 70px; }

/* ── Fil de réponses (1 niveau) ────────────────────────────── */
.jx-c-replies {
    margin-top: 12px;
    padding-left: 18px;
    border-left: 2px solid var(--gray-100, #eef0f3);
}
.jx-c-replies .jx-c { padding: 14px 0; }
.jx-c-replies .jx-c:first-child { padding-top: 0; }
.jx-c-replies .jx-c-avatar { width: 28px; height: 28px; font-size: 11px; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 600px) {
    .jx-comments-head h2 { font-size: 22px; }
    .jx-comments-num { font-size: 16px; }
    .jx-c-form-bottom { padding-left: 0; }
    .jx-c-form-fields { flex-direction: column; min-width: 0; }
    .jx-c-form-cta { width: 100%; justify-content: flex-end; }
    .jx-c-form-msg { flex: 1; }
    .jx-c-admin { margin-left: 0; padding-left: 12px; }
    .jx-c-replies { padding-left: 12px; }
    .jx-c-actions { flex-wrap: wrap; }
}

/* ──────────────────────────────────────────────────────────
   Modération commentaires (admin)
   ────────────────────────────────────────────────────────── */
.admin-comments-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.admin-comments-filters button {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 16px;
    padding: 6px 14px;
    cursor: pointer;
    font-size: 13px;
    color: var(--gray-700);
}
.admin-comments-filters button.active { background: var(--green); color: #fff; border-color: var(--green); }
/* Lien de page en haut de chaque commentaire admin */
.admin-comment-pagelink {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    color: var(--green-dark);
    background: var(--green-soft);
    border: 1px solid var(--green-light);
    border-radius: 6px;
    padding: 3px 10px;
    margin-bottom: 8px;
    text-decoration: none;
    transition: background .15s;
}
a.admin-comment-pagelink:hover { background: #c5e6d0; }
.admin-comment-pagelink-icon { font-size: 11px; opacity: .7; }

.admin-comment {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 12px;
}
.admin-comment.admin-comment-reply { background: var(--green-soft); border-color: var(--green); }
.admin-comment-meta {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--gray-600);
    margin-bottom: 8px;
}
.admin-comment-meta a { color: var(--green-dark); }
.admin-comment-author { font-weight: 700; color: var(--gray-800, #2d3338); }
.admin-comment-email { color: var(--gray-600); font-size: 12px; }
.admin-comment-body { color: var(--gray-800, #2d3338); line-height: 1.5; white-space: pre-wrap; }
.admin-comment-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.admin-reply-textarea { width: 100%; min-height: 70px; padding: 8px 10px; margin-top: 8px; border: 1px solid var(--gray-300, #d1d5db); border-radius: 6px; font-family: inherit; font-size: 13px; }
.admin-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 12px;
    flex-wrap: wrap;
}
.admin-toolbar h2 { margin: 0; font-size: 18px; }
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.admin-table th, .admin-table td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--gray-200);
}
.admin-table th { background: var(--gray-100); font-weight: 600; color: var(--gray-700); font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; }
.admin-table code { background: var(--gray-100); padding: 1px 6px; border-radius: 3px; font-family: var(--font-mono); font-size: 12px; }
.btn-link {
    background: none;
    border: none;
    color: var(--green);
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    padding: 4px 8px;
}
.btn-link:hover { text-decoration: underline; }
.btn-link.danger { color: #c00000; }
.admin-help { color: var(--gray-600); font-size: 13px; margin: 0 0 12px; }

/* === Tableau de bord statistiques === */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin: 16px 0 24px;
}
.stats-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    padding: 16px 18px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.stats-label {
    font-size: 12px;
    text-transform: uppercase;
    color: var(--gray-600);
    letter-spacing: 0.04em;
}
.stats-value {
    font-size: 26px;
    font-weight: 700;
    color: var(--green-dark);
    font-variant-numeric: tabular-nums;
}
.stats-section {
    margin: 28px 0;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    padding: 18px 22px;
    box-shadow: var(--shadow-sm);
}
.stats-section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}
.stats-section-head h3 { margin: 0; font-size: 16px; }
.stats-controls {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}
.stats-controls label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--gray-600);
}
.stats-controls select {
    padding: 6px 10px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    background: #fff;
    font-family: inherit;
    font-size: 13px;
}
.stats-chart { min-height: 260px; }
.chart-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 6px;
    font-size: 13px;
    color: var(--gray-700);
}
.chart-title { font-weight: 600; }
.chart-total { color: var(--green-dark); font-weight: 600; }
.chart-svg { width: 100%; height: auto; max-height: 280px; display: block; }
.chart-wrap { position: relative; }
.chart-hit { cursor: crosshair; }
.chart-hit:hover + .chart-dot,
.chart-dot.is-active { r: 5; }
.chart-tooltip {
    position: absolute;
    z-index: 50;
    background: var(--gray-900);
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.4;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: var(--shadow-lg);
    transform: translateZ(0); /* GPU layer pour réduire le scintillement */
}
.chart-tooltip[hidden] { display: none; }
.chart-tooltip strong { color: #fff; font-weight: 600; }
.chart-tooltip::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--gray-900);
    border-bottom: 0;
}
.chart-tooltip-value {
    font-variant-numeric: tabular-nums;
    font-size: 13px;
    font-weight: 700;
}


.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 18px;
    margin-top: 24px;
}
.stats-grid > div {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    padding: 16px 18px;
    box-shadow: var(--shadow-sm);
}
.stats-grid h3 { margin: 0 0 12px; font-size: 15px; }
.admin-table.compact th, .admin-table.compact td { padding: 8px 10px; font-size: 13px; }
.vote-score { font-variant-numeric: tabular-nums; }

.admin-rule-banner {
    background: #fff3cd;
    border: 1px solid #e08214;
    border-radius: 8px;
    padding: 14px 18px;
    margin: 16px 0 22px;
}
.admin-rule-banner summary {
    cursor: pointer;
    font-weight: 600;
    color: #8a4f00;
    font-size: 14px;
}
.admin-rule-banner p {
    margin: 10px 0;
    color: #5c3a00;
    font-size: 13px;
    line-height: 1.55;
}
.admin-rule-banner ol { margin: 10px 0 6px 22px; color: #5c3a00; font-size: 13px; }
.admin-rule-banner pre {
    background: #fff;
    border: 1px solid #e8d5b0;
    border-radius: 6px;
    padding: 12px 14px;
    overflow-x: auto;
    margin: 8px 0;
    font-size: 12px;
}
.admin-rule-banner code { font-family: var(--font-mono); }
.admin-rule-banner pre code { background: none; padding: 0; }
.admin-rule-banner a { color: #c46a00; text-decoration: underline; }

/* ======== Tri de colonnes (admin) ======== */
.sortable-table th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 24px; /* place pour l'icône de tri */
    transition: background-color 0.15s ease, color 0.15s ease;
}
.sortable-table th.sortable:hover {
    background: var(--gray-200);
    color: var(--gray-900);
}
.sortable-table th.sortable::after {
    content: '⇅';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    color: var(--gray-400);
    opacity: 0.6;
    transition: color 0.15s ease, opacity 0.15s ease;
}
.sortable-table th.sortable:hover::after {
    opacity: 1;
}
.sortable-table th.sort-asc::after {
    content: '▲';
    color: var(--green);
    opacity: 1;
    font-size: 10px;
}
.sortable-table th.sort-desc::after {
    content: '▼';
    color: var(--green);
    opacity: 1;
    font-size: 10px;
}
.sortable-table th.sort-asc,
.sortable-table th.sort-desc {
    color: var(--green-dark);
    background: var(--green-soft);
}
.sortable-table th.sortable:focus-visible {
    outline: 2px solid var(--green);
    outline-offset: -2px;
}



.admin-help code { background: var(--gray-100); padding: 1px 6px; border-radius: 3px; font-family: var(--font-mono); font-size: 12px; }
#editor, .admin-card {
    margin-top: 24px;
    padding: 24px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
}
.admin-card { margin-bottom: 20px; }
.admin-card h3 { margin: 0 0 14px; font-size: 16px; }
.admin-card label,
#editor label { display: block; font-weight: 500; font-size: 13px; color: var(--gray-700); margin: 12px 0 6px; }
.admin-card input[type="text"],
.admin-card select,
#editor input[type="text"],
#editor select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
    background: var(--white);
}
.admin-card textarea,
#editor textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.5;
    resize: vertical;
    box-sizing: border-box;
}

/* Formulaire structuré admin */
.admin-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
@media (max-width: 700px) {
    .form-row { grid-template-columns: 1fr; gap: 14px; }
}
.form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.form-field > span {
    font-weight: 500;
    font-size: 13px;
    color: var(--gray-800);
}
.form-field input[type="text"],
.form-field select,
.form-field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
    background: var(--white);
    box-sizing: border-box;
}
.form-field textarea {
    font-family: var(--font);
    line-height: 1.5;
    resize: vertical;
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 2px rgba(33,115,70,0.12);
}
.form-field input[readonly] {
    background: var(--gray-100);
    color: var(--gray-600);
    cursor: not-allowed;
}

.admin-fieldset {
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    padding: 16px 18px;
    margin: 0;
}
.admin-fieldset legend {
    font-weight: 600;
    color: var(--gray-900);
    padding: 0 8px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 14px;
}
.admin-fieldset legend .btn-link {
    font-size: 13px;
}

/* Liste répétable (args, examples, useCases) */
.rep-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.rep-item {
    display: grid;
    grid-template-columns: 180px 1fr 110px 40px;
    gap: 10px;
    align-items: center;
    padding: 10px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 4px;
}
.rep-item.rep-vertical {
    grid-template-columns: 1fr;
    gap: 8px;
}
.rep-item input[type="text"] {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    font-family: inherit;
    font-size: 13px;
    background: var(--white);
    box-sizing: border-box;
}
.rep-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--gray-700);
}
.rep-checkbox input { accent-color: var(--green); }
.btn-link.rep-del {
    font-size: 18px;
    color: #c00000;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
}
.btn-link.rep-del:hover { background: rgba(192,0,0,0.08); }
@media (max-width: 700px) {
    .rep-item { grid-template-columns: 1fr; }
}
.admin-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    flex-wrap: wrap;
}
.btn.danger { background: #c00000; border-color: #c00000; color: var(--white); }
.btn.danger:hover { background: #a00000; border-color: #a00000; }
.admin-ok {
    background: var(--green-soft);
    color: var(--green-dark);
    padding: 12px 16px;
    border-radius: 4px;
    border: 1px solid var(--green-light);
    font-size: 14px;
}

/* ============================================ RESPONSIVE */
@media (max-width: 900px) {
    .nav-toggle { display: flex; }
    .main-nav {
        position: absolute;
        top: 72px;
        left: 0; right: 0;
        background: var(--white);
        border-bottom: 1px solid var(--gray-200);
        max-height: 0;
        overflow: hidden;
        transition: max-height 250ms ease;
    }
    .main-nav.open { max-height: 400px; }
    .main-nav ul {
        flex-direction: column;
        gap: 0;
        padding: 12px 16px;
    }
    .main-nav a {
        padding: 14px;
        border-radius: var(--radius-sm);
    }
    .hero-inner {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    .footer-inner {
        grid-template-columns: 1fr 1fr;
        gap: 32px;
    }
    .arg-list li {
        grid-template-columns: 1fr;
        gap: 4px;
    }
    .cta-box {
        grid-template-columns: 1fr;
        padding: 32px;
    }
    .cta-pile { align-items: flex-start; }
    .shortcuts-list li { grid-template-columns: 1fr; gap: 6px; }
}

@media (max-width: 600px) {
    /* ── Conteneur global ───────────────────────────── */
    .container { padding: 0 14px; }

    /* ── Hero & sections verticales ────────────────── */
    .hero { padding: 36px 0 24px; }
    .features, .popular, .formulas-list, .downloads,
    .contact-section { padding: 36px 0; }
    .page-hero { padding: 32px 0 20px; }
    .faq-section, .articles-section { padding: 24px 0; }

    /* ── Hero actions ───────────────────────────────── */
    .hero-actions { flex-direction: column; align-items: stretch; }
    .hero-actions .btn { text-align: center; }

    /* ── Formulaire contact ─────────────────────────── */
    .form-row { grid-template-columns: 1fr; gap: 0; }

    /* ── Pages formule (header + sections) ─────────── */
    .formula-header  { padding: 16px; }
    .formula-section { padding: 16px; }
    .contact-form    { padding: 16px; }
    .formula-page    { padding: 24px 0 48px; }

    /* ── Article body : aplati sur mobile ───────────── */
    /* On supprime la "carte" (fond blanc + bordure) pour  */
    /* que le contenu occupe toute la largeur disponible.  */
    .article-page { padding: 12px 0 40px; }
    .article-body {
        padding: 8px 0 0;
        border: none;
        border-radius: 0;
        box-shadow: none;
        background: transparent;
        max-width: 100%;
    }
    .article-body h1        { font-size: 1.55rem; margin-bottom: 10px; }
    .article-body .article-lead {
        font-size: 15px;
        padding-bottom: 16px;
        margin-bottom: 20px;
    }
    .article-body h2 {
        font-size: 17px;
        padding: 9px 12px;
        margin: 32px 0 12px;
        border-radius: 0 4px 4px 0;
    }
    .article-body h3        { font-size: 15px; margin: 18px 0 8px; }
    .article-body pre       { padding: 11px 12px; font-size: 13px; }
    .article-body blockquote { padding: 10px 12px; }
    .article-body table     { font-size: 12px; }
    .article-body th,
    .article-body td        { padding: 7px 8px; }

    /* ── Shortcut items ─────────────────────────────── */
    .shortcut-item { padding: 14px 0; }

    /* ── Cartes formules ────────────────────────────── */
    .formula-card { padding: 16px; }
    .formula-top-badge { right: 8px; }

    /* ── Cartes téléchargements ─────────────────────── */
    .download-card { padding: 16px; }

    /* ── Vote widget ────────────────────────────────── */
    .vote-widget { padding: 16px; gap: 12px; }

    /* ── FAQ items ──────────────────────────────────── */
    .faq-item summary  { padding: 12px 36px 12px 14px; }
    .faq-item p        { padding: 0 14px 12px; }
    .faq-item-actions  { padding: 0 14px 12px; }

    /* ── Visuel masqué ──────────────────────────────── */
    .hero-visual { display: none; }
    .cta-visual  { display: none; }
    .cta-box { grid-template-columns: 1fr; padding: 24px 16px; }

    /* ── Footer ─────────────────────────────────────── */
    .footer-inner {
        grid-template-columns: 1fr;
        gap: 24px;
        padding: 32px 12px 20px;
    }

    /* ── Breadcrumbs ────────────────────────────────── */
    .breadcrumbs { font-size: 12px; }

    /* ── Fond de page article blanc sur mobile ───────── */
    /* Sans la carte, on passe le fond à blanc pour que   */
    /* le contenu lise sans contraste résiduel.           */
    .article-page { background: var(--white); }

    /* ── Cartes articles (page tutoriels) ───────────── */
    .article-card { padding: 16px; }
    .articles-grid { gap: 14px; }

    /* ── scroll horizontal des tableaux ─────────────── */
    .article-body table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* === Admin responsive (mobile) === */
@media (max-width: 700px) {
    .admin-page .container { padding: 0 12px; }
    .admin-shell { box-shadow: none; border-radius: 0; }
    .admin-header { flex-direction: column; align-items: stretch; gap: 12px; padding: 16px; }
    .admin-header h1 { font-size: 18px; }
    .admin-content { padding: 16px 12px; }

    /* Onglets cachés, liste déroulante visible */
    .admin-tabs { display: none; }
    .admin-tabs-mobile {
        display: block;
        padding: 14px 12px 6px;
        background: var(--gray-100);
        border-bottom: 1px solid var(--gray-200);
    }

    /* Tableaux : scroll horizontal pour tout voir */
    .admin-table,
    .stats-grid > div,
    .stats-section {
        font-size: 13px;
    }
    .admin-content table.admin-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
        max-width: 100%;
    }
    /* Pas de wrap pour les en-têtes cliquables */
    .admin-table th, .admin-table td { padding: 8px 10px; }
    .admin-table input[type="number"] { width: 70px; }

    /* TOP 10 stats : autoriser le wrap des titres (sinon ils sont tronqués)
       et uniformiser la police entre les 4 cartes (rang / titre / nombre). */
    .admin-content .stats-grid table.admin-table {
        display: table;
        width: 100%;
        white-space: normal;
        table-layout: fixed;
        font-size: 13px;
    }
    .admin-content .stats-grid table.admin-table td {
        font-size: 13px;
        line-height: 1.35;
        padding: 8px 8px;
        vertical-align: top;
        word-break: break-word;
        white-space: normal;
    }
    /* Colonnes : rang 28px, titre flex, valeur 60px alignée à droite */
    .admin-content .stats-grid table.admin-table td:first-child { width: 28px; padding-right: 4px; }
    .admin-content .stats-grid table.admin-table td:last-child { width: 60px; text-align: right; padding-left: 4px; }
    .admin-content .stats-grid table.admin-table strong { font-weight: 600; font-size: 13px; }

    /* Formulaires : champs en pile */
    .form-row { flex-direction: column; gap: 12px; }
    .form-field input,
    .form-field select,
    .form-field textarea { width: 100%; }
    .admin-toolbar { flex-direction: column; align-items: stretch; gap: 10px; }
    .admin-toolbar > div { display: flex; gap: 8px; flex-wrap: wrap; }

    /* Cartes stats : pleine largeur */
    .stats-cards { grid-template-columns: 1fr 1fr; }
    .stats-value { font-size: 20px; }
    .stats-section { padding: 14px 12px; }
    .stats-section-head { flex-direction: column; align-items: stretch; }
    .stats-controls { width: 100%; }
    .stats-controls label { width: 100%; }
    .stats-controls select { flex: 1; }
    .stats-grid { grid-template-columns: 1fr; gap: 14px; }

    /* Notes : tableau scrollable + scroll horizontal */
    .sortable-table { white-space: nowrap; }

    /* Boutons admin plus compacts */
    .admin-actions { flex-wrap: wrap; }
    .admin-actions .btn { flex: 1 1 auto; min-width: 130px; }
}

@media (max-width: 420px) {
    .stats-cards { grid-template-columns: 1fr; }
}

/* ============================================================
   FAQ — formulaire utilisateur « Poser une question »
   ============================================================ */
.faq-ask {
    margin-top: 48px;
    padding: 24px;
    background: var(--green-soft, #eaf5ef);
    border: 1px solid #cfe5d9;
    border-radius: 10px;
}
.faq-ask h2 {
    margin: 0 0 6px;
    font-size: 1.3rem;
    color: var(--green-dark, #185a35);
}
.faq-ask > p {
    margin: 0 0 16px;
    color: var(--gray-700, #4a5560);
}
.faq-ask-field {
    display: block;
    margin: 0 0 12px;
}
.faq-ask-field > span {
    display: block;
    font-weight: 600;
    margin: 0 0 4px;
    color: var(--gray-800, #2d3338);
    font-size: 0.95em;
}
.faq-ask-field > span small {
    font-weight: 400;
    color: var(--gray-600, #5c6770);
}
.faq-ask-field input,
.faq-ask-field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cfd6dc;
    border-radius: 6px;
    font: inherit;
    background: #fff;
    box-sizing: border-box;
}
.faq-ask-field textarea { resize: vertical; min-height: 70px; }
.faq-ask-field input:focus,
.faq-ask-field textarea:focus {
    outline: 2px solid var(--green, #217346);
    outline-offset: -1px;
    border-color: var(--green, #217346);
}
.faq-ask-actions { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.faq-ask-msg {
    font-weight: 600;
    font-size: 0.95em;
}
.faq-ask-msg.ok  { color: var(--green-dark, #185a35); }
.faq-ask-msg.err { color: #a01010; }

/* Crédit affiché dans une FAQ publiée à partir d'une question utilisateur */
.faq-asked-by {
    margin: 12px 0 0;
    padding-top: 10px;
    border-top: 1px dashed #cfd6dc;
    font-size: 0.88em;
    color: var(--gray-600, #5c6770);
    font-style: italic;
}
.faq-asked-by strong { color: var(--green-dark, #185a35); font-style: normal; }

/* ============================================================
   ADMIN — pastille de notification sur les onglets
   (style « badge smartphone » : disque rouge avec compteur)
   ============================================================ */
.admin-tabs button { position: relative; }
.tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    margin-left: 8px;
    border-radius: 999px;
    background: #d8232c;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 0 0 2px #fff;
    vertical-align: middle;
    /* Pulse léger pour attirer l'attention quand le compteur change */
    animation: tabBadgePop .35s ease-out;
}
.tab-badge[hidden] { display: none; }
@keyframes tabBadgePop {
    0%   { transform: scale(0); }
    70%  { transform: scale(1.15); }
    100% { transform: scale(1); }
}
/* Sur l'onglet actif (fond foncé), garder le badge bien visible */
.admin-tabs button.active .tab-badge {
    box-shadow: 0 0 0 2px var(--green-dark, #185a35);
}

/* ============================================================
   ADMIN — modération des questions en attente
   ============================================================ */
.admin-sep { border: 0; border-top: 1px solid var(--gray-200, #e5e8eb); margin: 22px 0; }

/* ============================================================
   Bannière "Modifications non publiées" (admin)
   Fixée en bas de l'écran, persistante tant que site-overrides.js
   n'a pas été regénéré.
   ============================================================ */
.publish-banner {
    position: fixed;
    bottom: 16px;
    left: 16px;
    right: 16px;
    max-width: 720px;
    margin: 0 auto;
    background: linear-gradient(135deg, #fff8eb, #fef3e7);
    border: 2px solid #c4961a;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(196, 150, 26, .35);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    z-index: 10050;
    animation: publishBannerIn .35s cubic-bezier(.22, 1, .36, 1);
}
@keyframes publishBannerIn {
    from { transform: translateY(120%); opacity: 0; }
    to   { transform: none; opacity: 1; }
}
.publish-banner-icon { font-size: 28px; flex-shrink: 0; }
.publish-banner-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.publish-banner-text strong { color: #7a5c0a; font-size: 15px; }
.publish-banner-text span   { color: #5c4400; font-size: 13px; line-height: 1.45; }
.publish-banner-text code   { background: rgba(0,0,0,.05); padding: 1px 6px; border-radius: 4px; font-size: 12px; }
.publish-banner-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.publish-banner-actions .btn { padding: 9px 18px; font-size: 14px; }
.publish-banner-close {
    background: none; border: none;
    color: #7a5c0a;
    font-size: 18px;
    width: 30px; height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-family: inherit;
    transition: background .15s;
}
.publish-banner-close:hover { background: rgba(196, 150, 26, .15); }

@media (max-width: 600px) {
    .publish-banner { flex-direction: column; align-items: stretch; text-align: center; }
    .publish-banner-icon { font-size: 24px; }
    .publish-banner-actions { justify-content: center; }
}

/* Badges d'état dans l'onglet Sauvegarde */
.publish-status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.publish-status-pending {
    background: #c4961a;
    color: #fff;
    animation: pulseAttention 2s ease-in-out infinite;
}
@keyframes pulseAttention {
    0%, 100% { box-shadow: 0 0 0 0 rgba(196, 150, 26, .5); }
    50%      { box-shadow: 0 0 0 8px rgba(196, 150, 26, 0); }
}
.publish-status-ok {
    background: var(--green-soft, #eaf5ef);
    color: var(--green-dark, #185a35);
    border: 1px solid #b0d9c0;
}

.faq-pending-card {
    background: #fff8eb;
    border: 1px solid #f0d8a0;
    border-radius: 10px;
    padding: 18px 20px;
    margin: 10px 0 18px;
}
.faq-pending-card h3 {
    margin: 0 0 8px;
    color: #7a5c0a;
    display: flex; align-items: center; gap: 10px;
}
.faq-pending-badge {
    display: inline-block;
    background: #c4961a; color: #fff;
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 0.82em;
    font-weight: 700;
    min-width: 22px; text-align: center;
}
.faq-pending-badge.zero { background: var(--gray-400, #aab1b8); }

.faq-pending-item {
    background: #fff;
    border: 1px solid #e9d8a8;
    border-radius: 8px;
    padding: 14px 16px;
    margin: 10px 0 0;
}
.faq-pending-head {
    display: flex; flex-direction: column; gap: 4px;
    margin-bottom: 10px;
}
.faq-pending-head > strong { color: var(--gray-900, #1c2227); font-size: 1.02em; }
.faq-pending-meta {
    font-size: 0.85em; color: var(--gray-600, #5c6770);
}
.faq-pending-meta em { font-style: normal; font-weight: 600; color: var(--gray-800, #2d3338); }
.faq-pending-item textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    border: 1px solid var(--gray-300, #d8dcdf);
    border-radius: 6px;
    font: inherit;
    resize: vertical;
}

