/* === Cours de grammaire et éditeur de règles === */

.grammaire h4,
.editeur-regles h4 {
    font-family: var(--serif);
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
}

.aide {
    font-size: 0.9rem;
    color: var(--encre-douce);
    margin-bottom: 0.75rem;
}

/* Tableaux de conjugaison */
.defilant {
    overflow-x: auto;
    margin: 0.5rem 0 1rem;
}

table.grille {
    width: auto;
    min-width: 100%;
}

table.grille th,
table.grille td {
    padding: 0.4rem 0.7rem;
    white-space: nowrap;
}

table.grille tbody th {
    font-weight: 600;
    color: var(--encre-douce);
    font-size: 0.9rem;
}

.groupe {
    padding: 1rem 0;
    border-top: 1px solid var(--bordure);
}

.groupe:first-of-type {
    border-top: none;
}

/* Exemples de phrases */
.exemples {
    list-style: none;
    margin-top: 0.75rem;
}

.exemples li {
    padding: 0.4rem 0.8rem;
    margin-bottom: 0.4rem;
    background-color: var(--surface-2);
    border-left: 3px solid var(--or);
    border-radius: 6px;
}

.exemples .fr {
    color: var(--encre-douce);
}

.liste-verbes {
    font-size: 0.92rem;
    line-height: 1.8;
}

/* Sommaire */
.sommaire {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1.5rem;
}

.sommaire a {
    padding: 0.35rem 0.85rem;
    font-size: 0.9rem;
    text-decoration: none;
    background-color: var(--surface);
    border: 1px solid var(--bordure);
    border-radius: 999px;
}

.sommaire a:hover {
    border-color: var(--accent);
}

.grammaire section {
    scroll-margin-top: 4.5rem;
}

.grammaire select {
    max-width: 420px;
}

/* --- Éditeur --- */
.editeur-regles .ligne {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem 1.25rem;
    margin-bottom: 0.75rem;
}

.editeur-regles .ligne label {
    flex: 1 1 200px;
    max-width: 320px;
}

.editeur-regles label input,
.editeur-regles label select {
    margin-top: 0.3rem;
    font-weight: normal;
}

.grille-champs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 0.75rem;
}

.editeur-regles table.grille input {
    width: 7.5rem;
    padding: 0.35rem 0.5rem;
    font-family: var(--serif);
}

.editeur-regles table.grille input::placeholder {
    color: var(--encre-douce);
    opacity: 0.6;
}

button.secondaire {
    color: var(--encre);
    background-color: var(--surface-2);
    border: 1px solid var(--bordure);
}

button.secondaire:hover {
    background-color: var(--accent-doux);
}

/* Barre d'enregistrement toujours visible */
.barre-enregistrer {
    position: sticky;
    top: 3.4rem;
    z-index: 5;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
}

.barre-enregistrer p {
    flex: 1 1 300px;
    font-size: 0.9rem;
    color: var(--encre-douce);
}

#statut.succes {
    color: #1e6b4a;
    font-weight: 600;
}

#statut.echec {
    color: #c0392b;
    font-weight: 600;
}

@media (prefers-color-scheme: dark) {
    #statut.succes { color: #8fe0bb; }
    #statut.echec { color: #f4a3b0; }
}
