/* Info-Mods V3 : bilans comparatifs des tests historiques uniquement.
   La classe est ajoutée par LegacyHtmlSanitizer après reconnaissance
   des deux en-têtes ; ne pas cibler les autres tableaux (photos, données...). */
.phoenix-test-page .phoenix-article-content table.phoenix-legacy-verdict {
    width: 100%;
    max-width: 100%;
    margin: 18px 0 22px;
    border: 1px solid #d6e3f1;
    border-radius: 10px;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
    overflow: hidden;
    background: #f9fcff;
    color: #38516b;
    text-align: left;
    box-shadow: 0 2px 9px rgb(16 54 93 / 5%);
}
.phoenix-test-page .phoenix-article-content table.phoenix-legacy-verdict > tbody > tr > :is(td, th),
.phoenix-test-page .phoenix-article-content table.phoenix-legacy-verdict > thead > tr > :is(td, th),
.phoenix-test-page .phoenix-article-content table.phoenix-legacy-verdict > tr > :is(td, th) {
    box-sizing: border-box;
    padding: 12px 16px;
    border: 0;
    border-bottom: 1px solid #dce7f3;
    background: #f9fcff;
    color: inherit;
    text-align: left;
    vertical-align: top;
    overflow-wrap: anywhere;
}
/* Les deux cellules d'en-tête peuvent être des <td> dans le HTML de 2003. */
.phoenix-test-page .phoenix-article-content table.phoenix-legacy-verdict > tbody > tr:first-child > :is(td, th),
.phoenix-test-page .phoenix-article-content table.phoenix-legacy-verdict > thead > tr:first-child > :is(td, th),
.phoenix-test-page .phoenix-article-content table.phoenix-legacy-verdict > tr:first-child > :is(td, th) {
    width: 50%;
    padding: 11px 13px;
    background: #e9f3ff;
    color: #164773;
    font-weight: 700;
    text-align: center;
}
.phoenix-test-page .phoenix-article-content table.phoenix-legacy-verdict > tbody > tr > :first-child,
.phoenix-test-page .phoenix-article-content table.phoenix-legacy-verdict > thead > tr > :first-child,
.phoenix-test-page .phoenix-article-content table.phoenix-legacy-verdict > tr > :first-child {
    border-right: 1px solid #dce7f3;
}
.phoenix-test-page .phoenix-article-content table.phoenix-legacy-verdict > tbody > tr:last-child > :is(td, th),
.phoenix-test-page .phoenix-article-content table.phoenix-legacy-verdict > tr:last-child > :is(td, th) {
    border-bottom: 0;
}
/* Les anciennes couleurs HTML bgcolor et font[color] ne doivent plus déborder. */
.phoenix-test-page .phoenix-article-content table.phoenix-legacy-verdict :is(font, span, strong, b, div, p, li) {
    color: inherit;
}
.phoenix-test-page .phoenix-article-content table.phoenix-legacy-verdict :is(ul, ol) {
    margin: 0;
    padding-left: 20px;
    text-align: left;
}
.phoenix-test-page .phoenix-article-content table.phoenix-legacy-verdict li {
    margin: 3px 0;
    text-align: left;
}
/* Palette sombre : même rendu / même hiérarchie / contrastes adaptés. */
html[data-theme="dark"] .phoenix-test-page .phoenix-article-content table.phoenix-legacy-verdict {
    border-color: #3b526e;
    background: #1b2b3d;
    color: #d2e0f0;
    box-shadow: none;
}
html[data-theme="dark"] .phoenix-test-page .phoenix-article-content table.phoenix-legacy-verdict > :is(tbody, thead) > tr > :is(td, th),
html[data-theme="dark"] .phoenix-test-page .phoenix-article-content table.phoenix-legacy-verdict > tr > :is(td, th) {
    border-color: #3b526e;
    background: #1b2b3d;
    color: #d2e0f0;
}
html[data-theme="dark"] .phoenix-test-page .phoenix-article-content table.phoenix-legacy-verdict > :is(tbody, thead) > tr:first-child > :is(td, th),
html[data-theme="dark"] .phoenix-test-page .phoenix-article-content table.phoenix-legacy-verdict > tr:first-child > :is(td, th) {
    background: #264564;
    color: #ecf5ff;
}
@media (max-width: 640px) {
    .phoenix-test-page .phoenix-article-content table.phoenix-legacy-verdict > :is(tbody, thead) > tr > :is(td, th),
    .phoenix-test-page .phoenix-article-content table.phoenix-legacy-verdict > tr > :is(td, th) {
        padding: 9px 10px;
    }
    .phoenix-test-page .phoenix-article-content table.phoenix-legacy-verdict :is(ul, ol) {
        padding-left: 16px;
    }
}
@media print {
    .phoenix-test-page .phoenix-article-content table.phoenix-legacy-verdict {
        box-shadow: none;
        break-inside: avoid;
    }
}


/* Tableaux historiques de CARACTÉRISTIQUES : deux colonnes libellé / valeur.
   Classés après assainissement HTML ; les tableaux de photos ne sont pas ciblés. */
.phoenix-test-page .phoenix-article-content table.phoenix-legacy-specs {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    margin: 18px auto 24px;
    border: 1px solid #d6e3f1;
    border-radius: 10px;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: auto;
    overflow: hidden;
    background: #f9fcff;
    color: #38516b;
    text-align: left;
    box-shadow: 0 2px 9px rgb(16 54 93 / 5%);
}
.phoenix-test-page .phoenix-article-content table.phoenix-legacy-specs > :is(thead, tbody, tfoot) > tr > :is(td, th),
.phoenix-test-page .phoenix-article-content table.phoenix-legacy-specs > tr > :is(td, th) {
    box-sizing: border-box;
    padding: 11px 15px;
    border: 0;
    border-bottom: 1px solid #dce7f3;
    color: inherit;
    background: #f9fcff;
    vertical-align: middle;
    text-align: left;
    overflow-wrap: anywhere;
    line-height: 1.5;
}
.phoenix-test-page .phoenix-article-content table.phoenix-legacy-specs > :is(thead, tbody, tfoot) > tr > :first-child,
.phoenix-test-page .phoenix-article-content table.phoenix-legacy-specs > tr > :first-child {
    width: 30%;
    background: #e9f3ff;
    color: #164773;
    font-weight: 700;
    border-right: 1px solid #dce7f3;
}
.phoenix-test-page .phoenix-article-content table.phoenix-legacy-specs > :is(thead, tbody, tfoot) > tr:last-child > :is(td, th),
.phoenix-test-page .phoenix-article-content table.phoenix-legacy-specs > tr:last-child > :is(td, th) {
    border-bottom: 0;
}
.phoenix-test-page .phoenix-article-content table.phoenix-legacy-specs :is(font, span, strong, b, div, p) {
    color: inherit;
    background: transparent;
}
.phoenix-test-page .phoenix-article-content table.phoenix-legacy-specs :is(ul, ol) {
    margin: 0;
    padding-left: 20px;
    text-align: left;
}
html[data-theme="dark"] .phoenix-test-page .phoenix-article-content table.phoenix-legacy-specs {
    border-color: #3b526e;
    background: #1b2b3d;
    color: #d2e0f0;
    box-shadow: none;
}
html[data-theme="dark"] .phoenix-test-page .phoenix-article-content table.phoenix-legacy-specs > :is(thead, tbody, tfoot) > tr > :is(td, th),
html[data-theme="dark"] .phoenix-test-page .phoenix-article-content table.phoenix-legacy-specs > tr > :is(td, th) {
    border-color: #3b526e;
    background: #1b2b3d;
    color: #d2e0f0;
}
html[data-theme="dark"] .phoenix-test-page .phoenix-article-content table.phoenix-legacy-specs > :is(thead, tbody, tfoot) > tr > :first-child,
html[data-theme="dark"] .phoenix-test-page .phoenix-article-content table.phoenix-legacy-specs > tr > :first-child {
    background: #264564;
    color: #ecf5ff;
}
@media (max-width: 600px) {
    .phoenix-test-page .phoenix-article-content table.phoenix-legacy-specs,
    .phoenix-test-page .phoenix-article-content table.phoenix-legacy-specs > :is(thead, tbody, tfoot),
    .phoenix-test-page .phoenix-article-content table.phoenix-legacy-specs > :is(thead, tbody, tfoot) > tr {
        display: block;
        width: 100%;
    }
    .phoenix-test-page .phoenix-article-content table.phoenix-legacy-specs > :is(thead, tbody, tfoot) > tr > :is(td, th) {
        display: block;
        width: 100% !important;
        padding: 9px 12px;
        border-right: 0;
        text-align: left;
    }
    .phoenix-test-page .phoenix-article-content table.phoenix-legacy-specs > :is(thead, tbody, tfoot) > tr > :first-child {
        border-bottom: 0;
        padding-bottom: 5px;
    }
    .phoenix-test-page .phoenix-article-content table.phoenix-legacy-specs > :is(thead, tbody, tfoot) > tr > :last-child {
        padding-top: 4px;
        border-bottom: 1px solid #dce7f3;
    }
    html[data-theme="dark"] .phoenix-test-page .phoenix-article-content table.phoenix-legacy-specs > :is(thead, tbody, tfoot) > tr > :last-child {
        border-color: #3b526e;
    }
    .phoenix-test-page .phoenix-article-content table.phoenix-legacy-specs > :is(thead, tbody, tfoot) > tr:last-child > :last-child {
        border-bottom: 0;
    }
}
@media print {
    .phoenix-test-page .phoenix-article-content table.phoenix-legacy-specs {
        box-shadow: none;
        break-inside: avoid;
    }
}


/* 28/10 : socle UNIQUE pour les anciens tableaux éditoriaux.
   Aucun sélecteur générique `table` : ne touche pas à l'administration,
   aux statistiques, aux composants publics ou aux tableaux modernes. */
.phoenix-article-content table.phoenix-legacy-table:not(.phoenix-legacy-layout):not(.phoenix-legacy-media) {
    box-sizing: border-box;
    width: 100%; max-width: 100%;
    margin: 18px auto 22px;
    border: 1px solid #d5e3f1;
    border-radius: 9px;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: auto;
    overflow: hidden;
    background: #fbfdff;
    color: #314d6a;
    box-shadow: 0 2px 8px rgb(16 54 93 / 5%);
}
.phoenix-article-content table.phoenix-legacy-table:not(.phoenix-legacy-layout):not(.phoenix-legacy-media) > :is(thead,tbody,tfoot) > tr > :is(td,th),
.phoenix-article-content table.phoenix-legacy-table:not(.phoenix-legacy-layout):not(.phoenix-legacy-media) > tr > :is(td,th) {
    box-sizing: border-box;
    min-width: 0;
    padding: 10px 13px;
    border: 0;
    border-bottom: 1px solid #dce7f3;
    border-right: 1px solid #dce7f3;
    color: inherit;
    background: #fbfdff;
    text-align: left;
    vertical-align: top;
    overflow-wrap: anywhere;
    line-height: 1.5;
}
.phoenix-article-content table.phoenix-legacy-table:not(.phoenix-legacy-layout):not(.phoenix-legacy-media) > :is(thead,tbody,tfoot) > tr > :is(td,th):last-child,
.phoenix-article-content table.phoenix-legacy-table:not(.phoenix-legacy-layout):not(.phoenix-legacy-media) > tr > :is(td,th):last-child {
    border-right: 0;
}
.phoenix-article-content table.phoenix-legacy-table:not(.phoenix-legacy-layout):not(.phoenix-legacy-media) > :is(thead,tbody,tfoot) > tr:last-child > :is(td,th),
.phoenix-article-content table.phoenix-legacy-table:not(.phoenix-legacy-layout):not(.phoenix-legacy-media) > tr:last-child > :is(td,th) {
    border-bottom: 0;
}
/* Les attributs HTML de l'ancien éditeur ne doivent pas imposer gris et jaune. */
.phoenix-article-content table.phoenix-legacy-table:not(.phoenix-legacy-layout):not(.phoenix-legacy-media) :is(font,span,strong,b,div,p,li) {
    color: inherit;
    background: transparent;
}
.phoenix-article-content table.phoenix-legacy-table:not(.phoenix-legacy-layout):not(.phoenix-legacy-media) :is(ul,ol) {
    margin: 2px 0; padding-left: 21px;
    text-align: left;
}
/* Verdicts 2 ou 3 colonnes, même pour les anciens TD faisant office de TH. */
.phoenix-article-content table.phoenix-legacy-verdict > :is(thead,tbody,tfoot) > tr:first-child > :is(td,th),
.phoenix-article-content table.phoenix-legacy-verdict > tr:first-child > :is(td,th) {
    background: #e9f3ff !important;
    color: #154878 !important;
    font-weight: 700; text-align: center;
    padding: 10px 13px;
}
.phoenix-article-content table.phoenix-legacy-verdict:not(.phoenix-legacy-verdict-3) > :is(thead,tbody,tfoot) > tr:first-child > :is(td,th) {
    width: 50%;
}
.phoenix-article-content table.phoenix-legacy-verdict-3 > :is(thead,tbody,tfoot) > tr:first-child > :first-child {
    width: 25% !important;
}
.phoenix-article-content table.phoenix-legacy-verdict-3 > :is(thead,tbody,tfoot) > tr:first-child > :nth-child(2),
.phoenix-article-content table.phoenix-legacy-verdict-3 > :is(thead,tbody,tfoot) > tr:first-child > :nth-child(3) {
    width: 37.5% !important;
}
.phoenix-article-content table.phoenix-legacy-verdict-3 img {
    max-width: 100%; height: auto;
}
/* Caractéristiques : libellé à gauche, valeur à droite. */
.phoenix-article-content table.phoenix-legacy-specs > :is(thead,tbody,tfoot) > tr > :first-child,
.phoenix-article-content table.phoenix-legacy-specs > tr > :first-child {
    width: 30%; background: #e9f3ff !important;
    color: #154878 !important; font-weight: 700;
}
/* Autres tableaux de données : une hiérarchie visuelle neutre. */
.phoenix-article-content table.phoenix-legacy-data > thead > tr > :is(th,td),
.phoenix-article-content table.phoenix-legacy-data th {
    background: #e9f3ff !important;
    color: #154878 !important;
    font-weight: 700;
}
/* Tableaux servant aux photos : supprimer les bordures vieillies, garder
   les images et leurs liens, sans les rogner ni modifier les proportions. */
.phoenix-article-content table.phoenix-legacy-media {
    box-sizing: border-box;
    width: 100%; max-width: 100%;
    margin: 14px auto 18px;
    border: 0; border-collapse: separate; border-spacing: 5px;
    background: transparent; color: inherit;
    table-layout: auto;
}
.phoenix-article-content table.phoenix-legacy-media > :is(thead,tbody,tfoot) > tr > :is(td,th),
.phoenix-article-content table.phoenix-legacy-media > tr > :is(td,th) {
    padding: 5px; border: 0; background: transparent;
    color: inherit; vertical-align: middle;
    text-align: center; overflow-wrap: anywhere;
}
.phoenix-article-content table.phoenix-legacy-media img {
    max-width: 100%; height: auto;
}
/* Les tableaux à vocation purement spatiale restent hors habillage. */
.phoenix-article-content table.phoenix-legacy-layout { max-width: 100%; }
/* Thème sombre de Phoenix. */
html[data-theme="dark"] .phoenix-article-content table.phoenix-legacy-table:not(.phoenix-legacy-layout):not(.phoenix-legacy-media) {
    border-color: #3b526e; background: #1b2b3d; color: #d2e0f0;
    box-shadow: none;
}
html[data-theme="dark"] .phoenix-article-content table.phoenix-legacy-table:not(.phoenix-legacy-layout):not(.phoenix-legacy-media) > :is(thead,tbody,tfoot) > tr > :is(td,th),
html[data-theme="dark"] .phoenix-article-content table.phoenix-legacy-table:not(.phoenix-legacy-layout):not(.phoenix-legacy-media) > tr > :is(td,th) {
    border-color: #3b526e;
    background: #1b2b3d; color: #d2e0f0;
}
html[data-theme="dark"] .phoenix-article-content table.phoenix-legacy-table.phoenix-legacy-verdict > :is(thead,tbody,tfoot) > tr:first-child > :is(td,th),
html[data-theme="dark"] .phoenix-article-content table.phoenix-legacy-table.phoenix-legacy-verdict > tr:first-child > :is(td,th),
html[data-theme="dark"] .phoenix-article-content table.phoenix-legacy-table.phoenix-legacy-specs > :is(thead,tbody,tfoot) > tr > :first-child,
html[data-theme="dark"] .phoenix-article-content table.phoenix-legacy-table.phoenix-legacy-data th {
    background: #264564 !important; color: #ecf5ff !important;
}
html[data-theme="dark"] .phoenix-article-content table.phoenix-legacy-media > :is(thead,tbody,tfoot) > tr > :is(td,th) {
    background: transparent; color: inherit;
}
@media (max-width: 640px) {
    .phoenix-article-content table.phoenix-legacy-table:not(.phoenix-legacy-layout):not(.phoenix-legacy-media) > :is(thead,tbody,tfoot) > tr > :is(td,th) {
        padding: 8px 9px;
        font-size: 0.94em;
    }
    /* Ne pas comprimer les trois colonnes du verdict jusqu'à l'illisibilité. */
    .phoenix-article-content table.phoenix-legacy-verdict-3 {
        display: block; overflow-x: auto; -webkit-overflow-scrolling: touch;
    }
    .phoenix-article-content table.phoenix-legacy-verdict-3 > tbody {
        display: table; width: 100%; min-width: 490px;
    }
    .phoenix-article-content table.phoenix-legacy-media { border-spacing: 2px; }
    .phoenix-article-content table.phoenix-legacy-media > :is(thead,tbody,tfoot) > tr > :is(td,th) {padding: 2px;}
}
@media print {
    .phoenix-article-content table.phoenix-legacy-table:not(.phoenix-legacy-media):not(.phoenix-legacy-layout) {
        box-shadow: none;
        break-inside: avoid;
    }
}

/* Three-column tables with direct <tr> (very old HTML, no explicit tbody). */
.phoenix-article-content table.phoenix-legacy-verdict-3 > tr:first-child > :first-child {width:25% !important;}
.phoenix-article-content table.phoenix-legacy-verdict-3 > tr:first-child > :nth-child(2),
.phoenix-article-content table.phoenix-legacy-verdict-3 > tr:first-child > :nth-child(3) {width:37.5% !important;}

/* Puces et numeros des listes dans les anciens tableaux DE DONNEES.
   Les tableaux de photos/layout restent hors champ. Les vieux contenus
   peuvent avoir des marges/paddings inline : on normalise ces seuls <ul>/<ol>. */
.phoenix-test-page .phoenix-article-content table.phoenix-legacy-table:not(.phoenix-legacy-media):not(.phoenix-legacy-layout) :is(td, th) :is(ul, ol) {
    box-sizing: border-box;
    margin: 4px 0 !important;
    padding: 0 0 0 28px !important;
    list-style-position: outside !important;
    text-align: left;
}
@media (max-width: 640px) {
    .phoenix-test-page .phoenix-article-content table.phoenix-legacy-table:not(.phoenix-legacy-media):not(.phoenix-legacy-layout) :is(td, th) :is(ul, ol) {
        padding-left: 25px !important;
    }
}

/* Listes historiques mal formees : <li> est parfois directement enfant de <td>,
   sans <ul>/<ol>. La regle des listes classiques ne les atteignait pas.
   On place les marqueurs DANS la cellule et on les decale des bordures.
   Ne cible jamais les tableaux de photos ou de mise en page. */
.phoenix-test-page .phoenix-article-content table.phoenix-legacy-table:not(.phoenix-legacy-media):not(.phoenix-legacy-layout) :is(td, th) > li {
    display: list-item;
    list-style-position: inside !important;
    text-align: left !important;
    padding-inline: 14px 8px !important;
    margin: 3px 0 !important;
    overflow-wrap: anywhere;
}
@media (max-width: 640px) {
    .phoenix-test-page .phoenix-article-content table.phoenix-legacy-table:not(.phoenix-legacy-media):not(.phoenix-legacy-layout) :is(td, th) > li {
        padding-inline-start: 10px !important;
    }
}
