* { box-sizing: border-box; }

body {
    max-width: 850px;
    margin: 30px auto;
    padding: 0 15px;
    background: #f5f6f8;
    color: #222;
    font-family: Arial, sans-serif;
}

/* En-tête */
.site-header {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    width: 100%;
    margin-bottom: 25px;
}

.entete-haut {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    min-width: 0;
}

.site-header h1,
.entete-haut h1 {
    margin: 0;
    margin-right: auto;
    font-size: 1.4rem;
    white-space: nowrap;
}

.entete-actions,
.liens-compte {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.lien-navigation,
.lien-compte {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    color: #1769aa;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
}

.lien-navigation:hover,
.lien-compte:hover { text-decoration: underline; }

.pseudo-connecte {
    color: #555;
    font-size: 13px;
    white-space: nowrap;
}

.lien-deconnexion {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #555;
    font-size: 23px;
    line-height: 1;
    text-decoration: none;
}

.lien-deconnexion:hover { color: #1769aa; }
.separateur-menu { color: #999; }

/* Langue de l'interface */
.interface-form {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    gap: 8px;
    margin: 0;
}

.interface-form select {
    max-width: 125px;
    min-width: 0;
    padding: 5px 6px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #fff;
    font-size: 12px;
    cursor: pointer;
}

/* Langues étudiées sur index.php */
.selecteurs-langues {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 22px;
    white-space: nowrap;
    overflow-x: auto;
}

.selecteurs-langues label {
    color: #555;
    font-size: 13px;
    white-space: nowrap;
}

.selecteurs-langues select {
    max-width: 130px;
    min-width: 0;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #fff;
    font-size: 13px;
}

/* Catégories */
.categorie {
    margin-bottom: 18px;
    overflow: hidden;
    border: 1px solid #ddd;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 2px 5px #00000008;
}

.categorie-barre {
    display: flex;
    align-items: stretch;
    background: #fff;
}

.categorie-entete {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 1;
    min-width: 0;
    padding: 18px 20px;
    border: none;
    background: transparent;
    color: #222;
    font-size: 20px;
    font-weight: bold;
    text-align: left;
    cursor: pointer;
}

.categorie-entete:hover { background: #f0f4f8; }

.fleche {
    margin-left: 12px;
    font-size: 18px;
    transition: transform 0.2s ease;
}

.categorie-entete[aria-expanded="true"] .fleche {
    transform: rotate(90deg);
}

.categorie-contenu { padding: 0 15px 15px; }
.categorie-contenu[hidden] { display: none; }
.categorie-principale > .categorie-contenu { padding-top: 1px; }

/* Sous-catégories */
.sous-categorie {
    margin-top: 12px;
    overflow: hidden;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    background: #fff;
}

.sous-categorie .categorie-entete {
    padding: 14px 15px;
    font-size: 17px;
}

/* Boutons des catégories */
.bouton-cacher {
    align-self: center;
    margin: 0 15px 0 5px;
    padding: 8px 12px;
    border: 1px solid #1769aa;
    border-radius: 6px;
    background: #fff;
    color: #1769aa;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
}

.bouton-cacher:hover { background: #eaf3fb; }

.sous-categorie .bouton-cacher {
    margin-right: 10px;
    padding: 7px 10px;
    font-size: 13px;
}

.actions-categorie {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    gap: 2px;
    margin-right: 12px;
}

.actions-categorie .bouton-cacher,
.actions-categorie .bouton-ajout-revision {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    margin: 0;
    padding: 0;
    border: 1px solid #d8d8d8;
    border-radius: 8px;
    background: transparent;
    color: inherit;
    cursor: pointer;
}

.actions-categorie .bouton-cacher:hover,
.actions-categorie .bouton-ajout-revision:hover {
    background: rgba(127, 127, 127, 0.12);
}

.actions-categorie .bouton-ajout-revision {
    font-size: 23px;
    font-weight: 400;
    line-height: 1;
}

.icone-oeil {
    display: block;
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Mots et traductions */
.mot-cible {
    display: inline-block;
    min-width: 3.5em;
    padding: 5px 7px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.mot-cible:hover { background: #edf4fb; }

.mot-cible.mot-cache {
    height: 1.8em;
    padding: 5px 7px;
    border-radius: 0.2em;
    background: #f1f3f5;
    color: transparent;
    user-select: none;
}

.mot-cible.mot-cache:hover { background: #e5e7eb; }

.mot-cible:focus {
    outline: 2px solid #1769aa;
    outline-offset: 2px;
}

/* Tableaux */
table { width: 100%; border-collapse: collapse; }

th, td {
    padding: 12px 8px;
    border-bottom: 1px solid #eee;
    text-align: left;
}

th {
    background: #f7f8fa;
    color: #555;
    font-size: 14px;
}

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

/* Messages */
.message {
    min-height: 18px;
    margin: 8px 0 0;
    color: #b42318;
    font-size: 13px;
}

/* Formulaires de compte */
.formulaire-compte {
    max-width: 430px;
    margin: 35px auto;
    padding: 25px;
    border: 1px solid #ddd;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 2px 5px #00000008;
}

.formulaire-compte h2 {
    margin-top: 0;
    margin-bottom: 22px;
    font-size: 21px;
}

.formulaire-compte form {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.formulaire-compte label {
    margin-top: 8px;
    color: #555;
    font-size: 14px;
}

.formulaire-compte input {
    width: 100%;
    padding: 11px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 15px;
}

.formulaire-compte input:focus {
    outline: 2px solid #1769aa;
    outline-offset: 1px;
}

.formulaire-compte button {
    margin-top: 15px;
    padding: 11px;
    border: none;
    border-radius: 6px;
    background: #1769aa;
    color: #fff;
    font-size: 15px;
    cursor: pointer;
}

.formulaire-compte button:hover { background: #12558c; }

.formulaire-compte p {
    margin-top: 20px;
    font-size: 14px;
}

.formulaire-compte a {
    color: #1769aa;
    text-decoration: none;
}

.formulaire-compte a:hover { text-decoration: underline; }

/* Mobile */
@media (max-width: 480px) {
    body { margin-top: 18px; }

    .entete-haut { gap: 5px; }

    .entete-haut h1,
    .site-header h1 { font-size: 17px; }

    .entete-actions,
    .liens-compte { gap: 5px; }

    .lien-navigation,
    .lien-compte { font-size: 11px; }

    .pseudo-connecte { font-size: 11px; }

    .interface-form select {
        max-width: 88px;
        padding: 4px 2px;
        font-size: 10px;
    }

    .selecteurs-langues { gap: 5px; }

    .selecteurs-langues select {
        max-width: 100px;
        padding: 4px;
        font-size: 11px;
    }

    .selecteurs-langues label { font-size: 11px; }

    th, td {
        padding: 10px 5px;
        font-size: 14px;
    }

    .categorie-entete { padding: 15px 10px; }
    .bouton-cacher { margin-right: 10px; padding: 7px 9px; }

    .sous-categorie .categorie-entete { padding: 13px 10px; }

    .sous-categorie .bouton-cacher {
        margin-right: 8px;
        padding: 6px 8px;
    }

    .actions-categorie {
        gap: 1px;
        margin-right: 8px;
    }

    .actions-categorie .bouton-cacher,
    .actions-categorie .bouton-ajout-revision {
        width: 29px;
        height: 29px;
        border-radius: 7px;
    }
}

#resultatRevision {
    margin-bottom: 15px;
}

#boutonValiderEcriture {
    margin-top: 15px;
}

/* Exemples des boutons + et - dans le message de fin */
.fin-revision .bouton-exemple {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    margin: 0 3px;
    padding: 0;
    border: 1px solid #d8d8d8;
    border-radius: 8px;
    background: transparent;
    color: inherit;
    font-size: 23px;
    font-weight: 400;
    line-height: 1;
    vertical-align: middle;
}

@media (max-width: 480px) {
    .fin-revision .bouton-exemple {
        width: 29px;
        height: 29px;
        border-radius: 7px;
    }
}
