/* P4.1 — lecture opt-in des cinq articles autorisés ; aucun style partagé modifié. */
body.article-reading-p4 .article-layout {
    grid-template-columns: minmax(0, 1fr) 300px;
}
body.article-reading-p4 .article-layout > *,
body.article-reading-p4 .article-body,
body.article-reading-p4 .step-card-content,
body.article-reading-p4 .signal-card,
body.article-reading-p4 .sipoc-letter-card {
    min-width: 0;
}
/* Les textes et formules se replient à leur taille actuelle, sans être rognés. */
body.article-reading-p4 .article-body,
body.article-reading-p4 .article-header h1,
body.article-reading-p4 .article-breadcrumb {
    overflow-wrap: anywhere;
}
body.article-reading-p4 .article-breadcrumb {
    flex-wrap: wrap;
}
body.article-reading-p4 .article-body .btn,
body.article-reading-p4 .article-sidebar .btn {
    max-width: 100%;
    white-space: normal;
}
body.article-reading-p4 .signal-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
}
body.article-reading-p4 .signal-num {
    flex-shrink: 0;
}
body.article-reading-p4 .sipoc-letters-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}
/* Régions natives : seules les tables qui dépassent défilent horizontalement. */
body.article-reading-p4 .p41-table-region {
    margin: var(--space-4) 0;
    min-width: 0;
}
body.article-reading-p4 .p41-table-region.p41-table-compact {
    margin: var(--space-3) 0 0;
}
body.article-reading-p4 .p41-table-scroll {
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overscroll-behavior-x: contain;
}
/* L'espacement passe au conteneur ; le tableau original et son style inline restent intacts. */
body.article-reading-p4 .p41-table-scroll > table {
    margin: 0 !important;
    overflow-wrap: normal;
}
body.article-reading-p4 .p41-table-scroll:focus-visible {
    outline: 3px solid var(--color-secondary);
    outline-offset: -3px;
}
body.article-reading-p4 .p41-scroll-hint {
    display: none;
    margin: 0 0 var(--space-2);
    font-size: var(--fs-sm);
    line-height: 1.5;
}
body.article-reading-p4 .p41-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}
@media (max-width: 968px) {
    body.article-reading-p4 .article-layout {
        grid-template-columns: minmax(0, 1fr);
    }
    body.article-reading-p4 .p41-scroll-hint {
        display: block;
    }
}
@media (max-width: 768px) {
    body.article-reading-p4 .sipoc-letters-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* P4.1 : dessin Pareto natif. Le tracé garde 720 px et défile localement au besoin. */
.article-reading-p4 .pareto-p4 {
    --pareto-bar: #0F766E;
    --pareto-bar-label: #FFFFFF;
    --pareto-curve: #4338CA;
    --pareto-threshold: #B45309;
    --pareto-grid: #CBD5E1;
    margin: var(--space-6) 0;
    padding: var(--space-2);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    background: var(--bg-surface-light);
    color: var(--text-primary);
    min-width: 0;
}
[data-theme="dark"] .article-reading-p4 .pareto-p4 {
    --pareto-bar: #2DD4BF;
    --pareto-bar-label: #0F172A;
    --pareto-curve: #A5B4FC;
    --pareto-threshold: #FBBF24;
    --pareto-grid: #475569;
}
.article-reading-p4 .pareto-p4 figcaption {
    font-weight: 700;
    line-height: 1.5;
}
.article-reading-p4 .pareto-p4-legend {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-5);
    padding: 0;
    margin: var(--space-3) 0;
    list-style: none;
    font-size: var(--fs-sm);
}
.article-reading-p4 .pareto-p4-legend li {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin: 0;
}
.article-reading-p4 .pareto-p4-key {
    display: inline-block;
    flex: 0 0 24px;
    width: 24px;
}
.article-reading-p4 .pareto-p4-key-bar { height: 12px; background: var(--pareto-bar); }
.article-reading-p4 .pareto-p4-key-curve { height: 0; border-top: 3px solid var(--pareto-curve); }
.article-reading-p4 .pareto-p4-key-threshold { height: 0; border-top: 2px dashed var(--pareto-threshold); }
.article-reading-p4 .pareto-p4-hint {
    margin: var(--space-3) 0;
    font-size: var(--fs-sm);
    line-height: 1.5;
}
.article-reading-p4 .pareto-p4-scroll {
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
}
.article-reading-p4 .pareto-p4-scroll:focus-visible {
    outline: 3px solid var(--color-secondary);
    outline-offset: -3px;
}
.article-reading-p4 .pareto-p4-chart {
    display: block;
    width: 720px;
    min-width: 720px;
    max-width: none;
    height: 430px;
    font-family: inherit;
    font-size: 14px;
    color: var(--text-primary);
}
.article-reading-p4 .pareto-p4-chart text { fill: currentColor; }
.article-reading-p4 .pareto-p4-axis-title { font-weight: 700; }
.article-reading-p4 .pareto-p4-grid { fill: none; stroke: var(--pareto-grid); stroke-width: 1; }
.article-reading-p4 .pareto-p4-axis { fill: none; stroke: currentColor; stroke-width: 1.5; }
.article-reading-p4 .pareto-p4-bars { fill: var(--pareto-bar); }
.article-reading-p4 .pareto-p4-counts text { fill: var(--pareto-bar-label); font-weight: 700; }
.article-reading-p4 .pareto-p4-threshold-halo { fill: none; stroke: var(--bg-surface-light); stroke-width: 6; stroke-dasharray: 8 5; }
.article-reading-p4 .pareto-p4-threshold { fill: none; stroke: var(--pareto-threshold); stroke-width: 2; stroke-dasharray: 8 5; }
.article-reading-p4 .pareto-p4-curve-halo { fill: none; stroke: var(--bg-surface-light); stroke-width: 7; stroke-linejoin: round; }
.article-reading-p4 .pareto-p4-curve { fill: none; stroke: var(--pareto-curve); stroke-width: 3; stroke-linejoin: round; }
.article-reading-p4 .pareto-p4-points { fill: var(--bg-surface-light); stroke: var(--pareto-curve); stroke-width: 2.5; }
.article-reading-p4 .pareto-p4-cumuls {
    font-weight: 700;
    stroke: var(--bg-surface-light);
    stroke-width: 5px;
    stroke-linejoin: round;
    paint-order: stroke fill;
}
