:root {
    /* Forme des boutons à libellé : pilule à rayon complet */
    --radius-pill: 999px;
    --primary: #0071E3;
    --secondary: #2997FF;
    --accent: #00cec9;
    --bg: #f5f7fa;
    --card: #ffffff;
    --text: #1d1d1f;
    --text-muted: #86868b;
    --border: #d2d2d7;
    --success: #00b894;
    --radius-lg: 20px;
    --radius-md: 12px;
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.12);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Header */
header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 0 40px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}

.logo-wrapper {
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.logo-wrapper img {
    width: 123%; /* Même technique de zoom que sur index */
    height: 123%;
    object-fit: cover;
}

.header-logo-text {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.02em;
}

.header-logo-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.header-nav {
    display: flex;
    gap: 16px;
}

.header-nav a {
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.2s ease;
}

.header-nav a:hover {
    background: rgba(0, 113, 227, 0.1);
    color: var(--primary);
}

.container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 48px 20px 60px;
}

.page-title {
    text-align: center;
    margin-bottom: 60px;
}

.page-title h1 {
    font-size: 3rem;
    font-weight: 900;
    letter-spacing: -0.04em;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 16px;
}

.page-title p {
    font-size: 1.25rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Steps */
.steps-container {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.step-card {
    background: var(--card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    display: flex;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.step-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.step-number {
    background: linear-gradient(180deg, var(--primary), var(--secondary));
    color: white;
    font-size: 2.5rem;
    font-weight: 900;
    min-width: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.step-body {
    padding: 32px 40px;
    flex: 1;
}

.step-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.step-icon {
    font-size: 2rem;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
}

.step-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.02em;
}

.step-desc {
    font-size: 1.1rem;
    color: #424245;
    line-height: 1.6;
    margin-bottom: 24px;
}

.step-tips {
    background: #fbfbfd;
    border: 1px solid #e5e5e7;
    padding: 20px 24px;
    border-radius: var(--radius-md);
}

.step-tips ul {
    list-style: none;
    margin-top: 12px;
}

.step-tips li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 12px;
    font-size: 0.95rem;
    color: #424245;
}

.step-tips li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: bold;
    font-size: 1.2rem;
}

/* Examples Section */
.examples-section {
    margin-top: 80px;
    background: white;
    border-radius: 30px;
    padding: 60px 40px;
    box-shadow: var(--shadow-md);
}

.examples-header {
    text-align: center;
    margin-bottom: 40px;
}

.examples-header h2 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 12px;
}

.examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.example-card {
    display: flex;
    align-items: center;
    gap: 20px;
    background: #f5f5f7;
    padding: 24px;
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.example-card:hover {
    background: white;
    border-color: var(--primary);
    transform: scale(1.02);
    box-shadow: var(--shadow-sm);
}

.example-icon {
    font-size: 2.5rem;
    background: white;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
}

.example-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text);
    margin-bottom: 4px;
}

.example-level {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
}

/* Roles */
.roles-section {
    margin-top: 80px;
}

.roles-section h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 40px;
}

.roles-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.role-card {
    background: white;
    padding: 40px;
    border-radius: 24px;
    box-shadow: var(--shadow-sm);
}

.role-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.role-icon {
    font-size: 2.5rem;
    color: var(--primary);
}

.role-title {
    font-size: 1.5rem;
    font-weight: 800;
}

.role-card ul {
    list-style: none;
}

.role-card li {
    padding: 8px 0;
    color: #424245;
    border-bottom: 1px solid #f5f5f7;
}

/* VIDEO */
.video-section iframe {
    max-width: 100% !important;
    border-radius: 24px !important;
    box-shadow: var(--shadow-lg) !important;
}

/* Chapitrage de la vidéo complète (v7.8.7) */
.tuto-chapter .tuto-video-chapters {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 1rem;
    display: grid;
    gap: 6px;
}
.tuto-video-chapters button {
    display: flex;
    align-items: baseline;
    gap: 12px;
    width: 100%;
    text-align: left;
    font: inherit;
    color: inherit;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease;
}
.tuto-video-chapters button:hover,
.tuto-video-chapters button.is-current { border-color: var(--primary); color: var(--primary); }
.tuto-video-chapters button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.tuto-video-time {
    flex-shrink: 0;
    min-width: 3.2em;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--primary);
}
.tuto-video-source { font-size: 0.9rem; }

/* FAQ */
.faq-section {
    margin-top: 80px;
}

.faq-section h2 {
    text-align: center;
    margin-bottom: 40px;
}

.faq-item {
    background: white;
    border-radius: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}

/* <button> depuis la v7 (c'était un <div onclick>, inatteignable au clavier).
   Les réinitialisations ci-dessous lui rendent l'apparence d'origine. */
.faq-question {
    width: 100%;
    padding: 24px 30px;
    font-family: inherit;
    font-weight: 700;
    font-size: 1.1rem;
    color: inherit;
    text-align: left;
    background: none;
    border: 0;
    border-radius: 16px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.faq-question:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: -3px;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    padding: 0 30px;
    transition: all 0.4s ease;
    color: #424245;
}

/* 500 px tronquaient les réponses les plus longues (scan/cartes ArUco). */
.faq-answer.open {
    max-height: 1600px;
    padding: 0 30px 24px 30px;
}

/* Les blocs de code (en-tête du fichier de questions, chemins…) débordaient
   de l'écran sur mobile et se faisaient rogner : aucun style ne leur était
   appliqué avant la v7. */
.faq-answer code,
.step-tips code,
.step-desc code,
.role-card code {
    overflow-wrap: anywhere;
    word-break: break-word;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 5px;
    padding: 1px 5px;
    font-size: 0.92em;
}

.faq-arrow { flex-shrink: 0; transition: transform 0.3s ease; color: var(--primary); }
.faq-question.open .faq-arrow { transform: rotate(180deg); }

/* CTA */
.cta-section {
    margin-top: 100px;
    background: linear-gradient(135deg, #0071E3, #000000);
    padding: 80px 40px;
    border-radius: 40px;
    text-align: center;
    color: white;
}

.cta-section h2 { font-size: 2.5rem; margin-bottom: 16px; }
.cta-section p { font-size: 1.25rem; opacity: 0.8; margin-bottom: 40px; }

.btn-cta {
    background: white;
    color: black;
    padding: 18px 48px;
    border-radius: var(--radius-pill);
    font-weight: 700;
    font-size: 1.1rem;
    text-decoration: none;
    transition: transform 0.2s ease;
}

.btn-cta:hover { transform: scale(1.05); }

/* Footer : composant commun dans assets/css/footer.css (v7).
   Seule reste ici la respiration propre à cette page, la colonne de
   contenu du tutoriel étant longue. */
.app-footer {
    margin-top: 80px;
}

@media (max-width: 768px) {
    .roles-grid { grid-template-columns: 1fr; }
    .step-card { flex-direction: column; }
    .step-number { min-width: unset; height: 100px; width: 100%; }
    .page-title h1 { font-size: 2.2rem; }
    .header { padding: 0 20px; }
    .header-nav { display: none; }
}

/* ============================================================
   v7.7 — Tutoriel : rail de chapitres, un chapitre par écran
   ------------------------------------------------------------
   La v7.6 avait découpé la page en 6 onglets surmontant un sommaire
   de partie. Deux défauts : les onglets, en pastilles claires sur
   fond clair, se voyaient à peine ; et chaque partie restait un
   déroulé de 5 à 10 chapitres qu'il fallait faire défiler.
   Nouvelle structure, inspirée de la doc de Sucrerie :
     • rail gauche = recherche + les 39 chapitres, groupés par partie,
                     l'entrée courante nettement marquée ;
     • contenu     = UN chapitre, rien d'autre ;
     • pager bas   = « Précédent · 7 / 39 · Suivant ».
   Les 6 parties ne sont plus des boutons mais des intertitres du rail.
   ============================================================ */

/* ---- Grille rail + contenu ---- */
.tuto-layout {
    display: grid;
    grid-template-columns: 292px minmax(0, 1fr);
    gap: 30px;
    align-items: start;
}

/* Le rail accompagne la lecture : il reste à l'écran et défile seul. */
.tuto-rail {
    position: sticky;
    top: 96px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px 12px;
    box-shadow: var(--shadow-sm);
    max-height: calc(100vh - 130px);
    overflow-y: auto;
    overscroll-behavior: contain;
}

/* L'intitulé de partie vit dans le markup (un <h2> par section) : le rail le
   recopie, et l'impression le ressort comme titre de partie. À l'écran, dans
   le flux du contenu, il ferait doublon avec le rail. */
.tuto-part-label { display: none; }

/* ---- Rail : les 6 parties, en accordéon ----
   Les 40 chapitres à plat faisaient un rail plus long que l'écran : on ne
   voyait ni où l'on était, ni combien il restait. Replié, il tient en six
   lignes, et l'en-tête de partie remplace l'ancienne barre d'onglets — même
   rôle, mais assez large pour porter l'intitulé entier et son compte. */
.tuto-nav-group + .tuto-nav-group { margin-top: 4px; }

.tuto-nav-part {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 12px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: var(--bg);
    color: var(--text);
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.tuto-nav-part:hover { border-color: var(--primary); color: var(--primary); }

.tuto-nav-part:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
}

/* Partie ouverte = celle qu'on lit : elle doit se distinguer des cinq autres
   sans crier, la vraie marque de position restant sur le chapitre. */
.tuto-nav-group.open > .tuto-nav-part {
    background: rgba(0, 113, 227, 0.1);
    border-color: rgba(0, 113, 227, 0.28);
    color: var(--primary);
}

.tuto-nav-part-icon { flex-shrink: 0; font-size: 1.05rem; line-height: 1; }
.tuto-nav-part-text { flex: 1; min-width: 0; line-height: 1.25; }

.tuto-nav-part-count {
    flex-shrink: 0;
    min-width: 22px;
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.07);
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.tuto-nav-group.open > .tuto-nav-part .tuto-nav-part-count {
    background: rgba(0, 113, 227, 0.16);
    color: var(--primary);
}

.tuto-nav-caret {
    flex-shrink: 0;
    font-size: 0.7rem;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.tuto-nav-group.open > .tuto-nav-part .tuto-nav-caret {
    transform: rotate(180deg);
    color: var(--primary);
}

/* ---- Rail : niveau 2, les chapitres de la partie ouverte ---- */
.tuto-nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin: 4px 0 8px 14px;
    padding-left: 8px;
    /* Le filet relie les chapitres à leur partie : sans lui, le niveau 2 flotte. */
    border-left: 2px solid var(--border);
}

.tuto-nav-list[hidden] { display: none; }

/* ---- Rail : les chapitres ---- */
.tuto-nav-item {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--text);
    text-decoration: none;
    /* La barre d'accent est toujours là, transparente : sans elle, l'entrée
       courante se décalerait de 3 px à la sélection. */
    border-left: 3px solid transparent;
    transition: background 0.15s ease, color 0.15s ease;
}

.tuto-nav-item:hover { background: rgba(0, 113, 227, 0.07); color: var(--primary); }

.tuto-nav-item:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
}

/* Entrée courante : c'est le repère de lecture, il doit se voir d'un coup
   d'œil dans une liste de 39. Fond teinté + barre d'accent + texte coloré. */
.tuto-nav-item.current {
    background: rgba(0, 113, 227, 0.11);
    border-left-color: var(--primary);
    color: var(--primary);
    font-weight: 800;
}

.tuto-nav-icon { flex-shrink: 0; font-size: 0.95rem; line-height: 1.35; }
.tuto-nav-text { min-width: 0; }

.tuto-search {
    position: relative;
    margin-bottom: 14px;
}

.tuto-search input {
    width: 100%;
    padding: 10px 12px 10px 34px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.88rem;
    background: var(--bg);
    color: var(--text);
}

.tuto-search input:focus {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
    border-color: var(--primary);
}

.tuto-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.85rem;
    pointer-events: none;
}

.tuto-toc-empty { font-size: 0.85rem; color: var(--text-muted); padding: 10px; }

/* ---- Chapitres ---- */
.tuto-panel[hidden] { display: none; }
.tuto-chapter[hidden] { display: none; }

.tuto-chapter {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px 30px;
    margin-bottom: 22px;
    box-shadow: var(--shadow-sm);
    scroll-margin-top: 96px;
}

.tuto-chapter > h2 {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tuto-chapter > h2 .ch-emoji { font-size: 1.4rem; }

.tuto-lead {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 18px;
}

.tuto-chapter h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 22px 0 8px;
}

.tuto-chapter p { margin-bottom: 12px; }

.tuto-chapter ul, .tuto-chapter ol { margin: 0 0 14px 0; padding-left: 22px; }
.tuto-chapter li { margin-bottom: 7px; }

.tuto-chapter code {
    background: rgba(0, 113, 227, 0.08);
    color: var(--primary);
    padding: 2px 6px;
    border-radius: 5px;
    font-size: 0.88em;
    font-family: 'SFMono-Regular', Consolas, monospace;
}

.tuto-chapter kbd {
    background: var(--bg);
    border: 1px solid var(--border);
    border-bottom-width: 2px;
    border-radius: 6px;
    padding: 1px 7px;
    font-size: 0.85em;
    font-family: inherit;
    font-weight: 700;
}

/* ---- Figures (captures d'écran) ---- */
.tuto-figure {
    margin: 18px 0 20px;
}

.tuto-figure img {
    width: 100%;
    display: block;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    background: var(--bg);
}

.tuto-figure figcaption {
    margin-top: 8px;
    font-size: 0.82rem;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.4;
}

/* Captures de téléphone : une image de 840 px de large affichée pleine
   largeur ferait un mur. On la borne et on la centre. */
.tuto-figure-phone img { max-width: 320px; margin: 0 auto; }

/* Petites fenêtres de dialogue (bibliothèque partagée) : capturées en x2 sur
   460 px, affichées à leur taille réelle plutôt qu'étirées sur toute la colonne. */
.tuto-figure-dialog img { max-width: 460px; margin: 0 auto; }

.tuto-figure-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

/* ---- Encadrés ---- */
.tuto-note {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    margin: 14px 0;
    font-size: 0.92rem;
    line-height: 1.55;
    border: 1px solid;
}

.tuto-note i { flex-shrink: 0; margin-top: 3px; font-size: 1rem; }
.tuto-note p:last-child { margin-bottom: 0; }

.tuto-note-tip { background: rgba(0, 184, 148, 0.08); border-color: rgba(0, 184, 148, 0.35); }
.tuto-note-tip i { color: #00996f; }

.tuto-note-warn { background: rgba(243, 156, 18, 0.10); border-color: rgba(243, 156, 18, 0.4); }
.tuto-note-warn i { color: #b9770e; }

.tuto-note-info { background: rgba(0, 113, 227, 0.07); border-color: rgba(0, 113, 227, 0.3); }
.tuto-note-info i { color: var(--primary); }

.tuto-note-new { background: rgba(108, 92, 231, 0.09); border-color: rgba(108, 92, 231, 0.35); }
.tuto-note-new i { color: #5b4bd6; }

/* ---- Tableaux d'options ---- */
.tuto-table-wrap { overflow-x: auto; margin: 14px 0 18px; }

.tuto-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    min-width: 480px;
}

.tuto-table th {
    text-align: left;
    background: var(--bg);
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    padding: 10px 12px;
    border-bottom: 2px solid var(--border);
}

.tuto-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
    line-height: 1.5;
}

.tuto-table tr:last-child td { border-bottom: none; }
.tuto-table td:first-child { font-weight: 700; white-space: nowrap; }

/* ---- Étapes numérotées ---- */
.tuto-steps { list-style: none; counter-reset: tstep; padding-left: 0 !important; }

.tuto-steps > li {
    counter-increment: tstep;
    position: relative;
    padding-left: 42px;
    margin-bottom: 14px;
}

.tuto-steps > li::before {
    content: counter(tstep);
    position: absolute;
    left: 0;
    top: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---- Badges ---- */
.tuto-badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: var(--radius-pill);
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    vertical-align: middle;
}

.tuto-badge-new { background: rgba(108, 92, 231, 0.15); color: #5b4bd6; }
.tuto-badge-classic { background: rgba(0, 113, 227, 0.13); color: var(--primary); }
.tuto-badge-scan { background: rgba(0, 184, 148, 0.15); color: #00815f; }

/* ---- Navigation bas de page entre onglets ---- */
/* ---- Pager : Précédent · 7 / 39 · Suivant ----
   Le compteur central est la seule indication d'avancement une fois la barre
   d'onglets partie : sans lui, on ne sait plus où l'on en est dans les 39
   chapitres. Il compte les chapitres affichés — pendant une recherche,
   « 2 / 5 » parle des 5 résultats. */
.tuto-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 8px 0 40px;
}

.pager-count {
    flex-shrink: 0;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.tuto-pager button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 12px 20px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tuto-pager button:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
}

.tuto-pager button:disabled { opacity: 0.35; cursor: default; }

.pager-dir { flex-shrink: 0; }

/* Le titre du chapitre voisin : utile, mais il ne doit pas pousser le bouton
   au-delà de la largeur disponible. */
.pager-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
    color: var(--text-muted);
}

.tuto-pager button:hover:not(:disabled) .pager-label { color: inherit; }
.tuto-pager button:disabled .pager-label { display: none; }

/* ---- Responsive ---- */
@media (max-width: 900px) {
    .tuto-layout { grid-template-columns: 1fr; }

    /* Sur mobile le rail passe au-dessus du contenu : le laisser collant et
       haut de 39 entrées enterrerait le chapitre sous la navigation. */
    .tuto-rail {
        position: static;
        max-height: 42vh;
    }

    .tuto-chapter { padding: 22px 18px; }
    .tuto-chapter > h2 { font-size: 1.3rem; }

    /* Le titre du chapitre voisin est le premier à sauter : garder « Précédent »
       et « Suivant » entiers compte davantage. */
    .pager-label { display: none; }
    .tuto-pager button { padding: 11px 16px; }
}

/* ---- Impression : tout déplier, pas de chrome d'interface ---- */
/* ---- Impression : tout déplier, pas de chrome d'interface ----
   À l'écran on lit un chapitre à la fois ; à l'impression on veut le document
   entier, parties comprises — d'où le [hidden] forcé sur les chapitres, que la
   navigation pose sur 38 d'entre eux. */
@media print {
    header, .tuto-rail, .tuto-pager, .cta-section, .app-footer, .video-section { display: none !important; }
    .tuto-layout { display: block; }
    .tuto-panel[hidden] { display: block !important; }
    .tuto-chapter[hidden] { display: block !important; }
    .tuto-chapter { break-inside: avoid; box-shadow: none; border-color: #ccc; }

    /* L'intitulé de partie, masqué à l'écran, redevient le titre de niveau 1. */
    .tuto-part-label {
        display: block;
        break-before: page;
        margin: 0 0 14px;
        font-size: 1.6rem;
        font-weight: 800;
    }
    .tuto-panel:first-of-type .tuto-part-label { break-before: auto; }
}
