h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "Une erreur s'est produite."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}
/* --- Mise en page de base --- */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    color: #1f2933;
    background: #f5f7f9;
}

.entete {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    padding: 0.75rem 1rem;
    background: #1f6f4a;
    color: #fff;
}

.titre-app {
    color: inherit;
    font-weight: 600;
    text-decoration: none;
}

.compte {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
}

.compte form {
    margin: 0;
}

.bouton-lien {
    padding: 0.25rem 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 0.375rem;
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.contenu {
    max-width: 60rem;
    margin: 0 auto;
    padding: 1rem;
}

/* --- Formulaires --- */
.carte-formulaire {
    max-width: 24rem;
    margin: 2rem auto;
    padding: 1.5rem;
    border-radius: 0.5rem;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.carte-formulaire h1 {
    margin-top: 0;
    font-size: 1.5rem;
}

.champ {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 1rem;
}

.champ input {
    padding: 0.625rem 0.75rem;
    border: 1px solid #9aa5b1;
    border-radius: 0.375rem;
    font: inherit;
}

.champ-case {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.champ-case input {
    width: 1.25rem;
    height: 1.25rem;
}

.bouton-principal {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 0;
    border-radius: 0.375rem;
    background: #1f6f4a;
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.message-erreur {
    margin: 0 0 1rem;
    padding: 0.625rem 0.75rem;
    border-radius: 0.375rem;
    background: #fdecea;
    color: #8a1c13;
}

.aide {
    color: #52606d;
    font-size: 0.875rem;
}

.lien-entete {
    color: inherit;
}

/* --- Comptes --- */
.liste-comptes {
    margin: 1rem 0;
    padding: 0;
    list-style: none;
    border-radius: 0.5rem;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.liste-comptes li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid #e4e7eb;
}

.liste-comptes li:first-child {
    border-top: 0;
}

.liste-comptes li.inactif .nom-compte,
.liste-comptes li.inactif .courriel-compte {
    color: #7b8794;
}

.infos-compte {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.nom-compte {
    font-weight: 600;
}

.courriel-compte {
    color: #52606d;
    font-size: 0.875rem;
    overflow-wrap: anywhere;
}

.pastille {
    margin-left: 0.375rem;
    padding: 0.0625rem 0.5rem;
    border-radius: 999px;
    background: #e4e7eb;
    color: #323f4b;
    font-size: 0.75rem;
    font-weight: 600;
}

.pastille-alerte {
    background: #fdecea;
    color: #8a1c13;
}

.bouton-secondaire {
    padding: 0.5rem 0.875rem;
    border: 1px solid #9aa5b1;
    border-radius: 0.375rem;
    background: #fff;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.bouton-principal:disabled {
    opacity: 0.6;
    cursor: default;
}

.carte-formulaire h2 {
    margin-top: 0;
    font-size: 1.25rem;
}

.message-succes {
    margin: 0 0 1rem;
    padding: 0.625rem 0.75rem;
    border-radius: 0.375rem;
    background: #e3f5ea;
    color: #14532d;
}

.etat-ok {
    color: #14532d;
    font-weight: 600;
}

.etat-erreur {
    color: #9b1c1c;
    font-weight: 600;
}

.details-diagnostic {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.25rem 1rem;
    margin: 0 0 1rem;
}

.details-diagnostic dt {
    color: #52606d;
}

.details-diagnostic dd {
    margin: 0;
    overflow-wrap: anywhere;
}

@media (max-width: 40rem) {
    .details-diagnostic {
        grid-template-columns: 1fr;
    }

    .details-diagnostic dd {
        margin-bottom: 0.375rem;
    }
}

.message-avertissement {
    margin: 0 0 1rem;
    padding: 0.625rem 0.75rem;
    border-radius: 0.375rem;
    background: #fff8e6;
    color: #744210;
}

.fiche {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.25rem 1rem;
    margin: 1rem 0;
}

.fiche dt {
    color: #52606d;
}

.fiche dd {
    margin: 0;
    overflow-wrap: anywhere;
}

/* --- Pages de liste et formulaires plus larges --- */
.entete-page {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
}

.actions-page {
    display: flex;
    gap: 0.5rem;
}

a.bouton-principal,
a.bouton-secondaire {
    display: inline-block;
    text-decoration: none;
    text-align: center;
}

.bouton-compact {
    width: auto;
    padding: 0.5rem 0.875rem;
}

.filtres {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0 1rem;
}

.filtres .champ {
    flex: 1 1 14rem;
}

.champ select,
.champ textarea,
.filtres input[type=search] {
    padding: 0.625rem 0.75rem;
    border: 1px solid #9aa5b1;
    border-radius: 0.375rem;
    background: #fff;
    font: inherit;
}

.champ textarea {
    resize: vertical;
}

.liste-cartes {
    margin: 0.5rem 0 1.5rem;
    padding: 0;
    list-style: none;
    border-radius: 0.5rem;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.liste-cartes li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid #e4e7eb;
}

.liste-cartes li:first-child {
    border-top: 0;
}

.liste-cartes li.inactif .nom-ligne {
    color: #7b8794;
}

.infos-ligne {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.infos-ligne .pastille {
    align-self: flex-start;
    margin: 0.125rem 0 0;
}

.nom-ligne {
    font-weight: 600;
    overflow-wrap: anywhere;
}

.details-ligne {
    color: #52606d;
    font-size: 0.875rem;
    overflow-wrap: anywhere;
}

.actions-ligne {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.bouton-icone {
    min-width: 2.5rem;
    min-height: 2.5rem;
    border: 1px solid #9aa5b1;
    border-radius: 0.375rem;
    background: #fff;
    font: inherit;
    cursor: pointer;
}

.bouton-icone:disabled {
    opacity: 0.35;
    cursor: default;
}

.renommage {
    display: flex;
    flex: 1;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.renommage input {
    flex: 1 1 10rem;
    padding: 0.5rem 0.625rem;
    border: 1px solid #9aa5b1;
    border-radius: 0.375rem;
    font: inherit;
}

.carte-large {
    max-width: 44rem;
    margin-left: 0;
}

.grille-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: 0 1rem;
}

.champ-case-aligne {
    align-self: end;
    margin-bottom: 1.5rem;
}

.message-erreur ul {
    margin: 0;
    padding-left: 1.25rem;
}

.visuellement-cache {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.message-info {
    margin: 0 0 1rem;
    padding: 0.625rem 0.75rem;
    border-radius: 0.375rem;
    background: #e8f0fb;
    color: #1d3d6b;
}

.confirmation {
    padding: 0.75rem 1rem;
    border: 1px solid #f0b429;
    border-radius: 0.375rem;
    background: #fffbea;
}

.confirmation p {
    margin-top: 0;
}

.confirmation ul {
    padding-left: 1.25rem;
}

/* --- Saisie d'une recette --- */
.grille-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
    gap: 0 1rem;
}

.champ input:not([type=checkbox]),
.grille-3 select,
.lignes-recette input:not([type=checkbox]),
.lignes-recette select,
.lignes-recette textarea,
.recherche-ingredient input,
.ajout-etiquette input {
    width: 100%;
    padding: 0.5rem 0.625rem;
    border: 1px solid #9aa5b1;
    border-radius: 0.375rem;
    background: #fff;
    font: inherit;
}

.lignes-recette {
    margin: 0 0 1rem;
    padding: 0;
    list-style: none;
}

.ligne-ingredient {
    display: grid;
    grid-template-columns: minmax(8rem, 1.4fr) 5rem 6.5rem minmax(8rem, 1.4fr) auto auto;
    grid-template-areas: "nom quantite unite precision optionnel actions";
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e4e7eb;
}

.zone-nom { grid-area: nom; }
.zone-quantite { grid-area: quantite; }
.zone-unite { grid-area: unite; }
.zone-precision { grid-area: precision; }
.zone-optionnel { grid-area: optionnel; margin: 0; }
.zone-actions { grid-area: actions; }

/* Import (story 8.3) : sous la ligne, le texte lu et le rapprochement à confirmer, sur toute la largeur. */
.zone-rapprochement {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem 0.5rem;
    font-size: 0.9rem;
}

.ligne-a-rapprocher {
    background: #fff8e6;
    border-left: 3px solid #d69e2e;
    padding-left: 0.5rem;
}

.texte-lu {
    color: #52606d;
    font-style: italic;
}

.statut-rapprochement {
    font-weight: 600;
}

.photos-import {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 0 0 1rem;
    padding: 0;
    list-style: none;
}

.photos-import li {
    position: relative;
}

.photos-import img {
    display: block;
    width: 7rem;
    height: 9rem;
    object-fit: cover;
    border: 1px solid #cbd2d9;
    border-radius: 0.375rem;
}

.photos-import .bouton-icone {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    background: #fff;
}

.attente-lecture {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    padding: 0.75rem;
    border-radius: 0.375rem;
    background: #eef6f1;
}

.roue {
    width: 1.25rem;
    height: 1.25rem;
    border: 3px solid #b7dcc6;
    border-top-color: #1f6f4a;
    border-radius: 50%;
    animation: tourner 0.9s linear infinite;
}

@keyframes tourner {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .roue {
        animation-duration: 3s;
    }
}

.import-texte textarea {
    width: 100%;
    min-height: 16rem;
    padding: 0.5rem 0.625rem;
    border: 1px solid #9aa5b1;
    border-radius: 0.375rem;
    font: inherit;
}

@media (max-width: 40rem) {
    .ligne-ingredient {
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "nom nom"
            "quantite unite"
            "precision precision"
            "optionnel actions";
    }

    .zone-actions {
        justify-self: end;
    }
}

.ligne-etape {
    display: grid;
    grid-template-columns: 2rem 1fr auto;
    align-items: start;
    gap: 0.5rem;
    padding: 0.5rem 0;
}

.numero-etape {
    padding-top: 0.5rem;
    font-weight: 600;
    text-align: right;
}

@media (max-width: 40rem) {
    .ligne-etape {
        grid-template-columns: 1.5rem 1fr;
    }

    .ligne-etape .actions-ligne {
        grid-column: 2;
        justify-self: end;
    }
}

.recherche-ingredient {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.suggestions {
    margin: 0;
    padding: 0;
    list-style: none;
    border: 1px solid #cbd2d9;
    border-radius: 0.375rem;
    background: #fff;
}

.suggestions button {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 0;
    border-top: 1px solid #e4e7eb;
    background: transparent;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.suggestions li:first-child button {
    border-top: 0;
}

.suggestions button:hover,
.suggestions button:focus-visible {
    background: #f0f4f8;
}

.suggestion-creer {
    color: #1f6f4a;
    font-weight: 600;
}

.creation-rapide {
    padding: 0.75rem 1rem;
    border: 1px solid #1f6f4a;
    border-radius: 0.375rem;
    background: #f3faf6;
}

.titre-creation {
    margin: 0 0 0.5rem;
    font-weight: 600;
}

.etiquettes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0 0 1rem;
    padding: 0;
    list-style: none;
}

.etiquettes li {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.25rem 0.25rem 0.75rem;
    border-radius: 999px;
    background: #e4e7eb;
}

.retirer-etiquette {
    min-width: 1.75rem;
    min-height: 1.75rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    cursor: pointer;
}

.ajout-etiquette {
    display: flex;
    gap: 0.5rem;
}

.barre-enregistrer {
    max-width: 44rem;
    margin-bottom: 2rem;
}

/* --- Photo de recette --- */
.photo-recette {
    display: block;
    width: 100%;
    max-height: 24rem;
    margin-bottom: 1rem;
    border-radius: 0.375rem;
    object-fit: cover;
    background: #e4e7eb;
}

.actions-photo {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.actions-photo label.bouton-secondaire {
    display: inline-block;
}

.actions-photo label.desactive {
    opacity: 0.6;
    cursor: default;
}

/* Le champ de fichier est caché : son focus clavier s'affiche sur l'étiquette qui le suit. */
.actions-photo input[type=file]:focus-visible + label {
    outline: 2px solid #1f6f4a;
    outline-offset: 2px;
}

.liste-cartes li.ligne-recette {
    justify-content: flex-start;
    flex-wrap: nowrap;
}

.vignette-recette {
    flex: none;
    width: 4rem;
    height: 4rem;
    border-radius: 0.375rem;
    object-fit: cover;
    background: #e4e7eb;
}

/* --- Consultation d'une recette --- */
.consultation {
    max-width: 60rem;
}

.photo-consultation {
    display: block;
    width: 100%;
    max-height: 22rem;
    margin-bottom: 1rem;
    border-radius: 0.5rem;
    object-fit: cover;
    background: #e4e7eb;
}

.consultation h1 {
    margin: 0;
}

.temps-recette {
    margin: 0.25rem 0 0.75rem;
    color: #52606d;
}

.etiquettes-lecture li {
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
}

.colonnes-recette {
    display: grid;
    gap: 1rem;
}

@media (min-width: 48rem) {
    .colonnes-recette {
        grid-template-columns: minmax(16rem, 2fr) 3fr;
        align-items: start;
    }
}

.carte-lecture {
    margin-bottom: 1rem;
    padding: 1rem 1.25rem;
    border-radius: 0.5rem;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.carte-lecture h2 {
    margin: 0 0 0.75rem;
    font-size: 1.25rem;
}

.selecteur-portions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    margin-bottom: 1rem;
}

.valeur-portions {
    min-width: 6.5rem;
    text-align: center;
}

.bouton-lien-texte {
    padding: 0;
    border: 0;
    background: none;
    color: #1f6f4a;
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}

.ingredients-lecture {
    margin: 0;
    padding: 0;
    list-style: none;
}

.ingredients-lecture li {
    display: grid;
    grid-template-columns: 6.5rem 1fr;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-top: 1px solid #e4e7eb;
    font-size: 1.0625rem;
}

.ingredients-lecture li:first-child {
    border-top: 0;
}

.quantite-lecture {
    font-weight: 600;
    text-align: right;
}

.etapes-lecture {
    margin: 0;
    padding-left: 1.5rem;
    font-size: 1.0625rem;
}

.etapes-lecture li {
    margin-bottom: 0.875rem;
    padding-left: 0.25rem;
    white-space: pre-line;
}

.notes-lecture {
    margin: 0;
    white-space: pre-line;
}

/* --- Recherche de recettes --- */
.resume-recherche {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem 1rem;
}

.resume-recherche .aide {
    margin: 0;
}

.filtres-recettes .champ {
    flex: 1 1 10rem;
}

/* --- Calendrier --- */
.navigation-semaine {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 0.5rem 0 1rem;
}

.titre-semaine {
    text-align: center;
}

.titre-semaine h2 {
    margin: 0;
    font-size: 1.125rem;
}

/* Trois rangées partagées par tous les jours (titre, dîner, souper) : les plages restent alignées
   d'une colonne à l'autre, quelle que soit la longueur des noms de recettes. */
.grille-semaine {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    grid-template-rows: auto auto auto;
    gap: 0 0.5rem;
    margin-bottom: 2rem;
}

.grille-semaine .jour {
    display: grid;
    grid-row: span 3;
    grid-template-rows: subgrid;
}

/* Le calendrier a besoin de plus de largeur que les autres pages. */
.contenu:has(.grille-semaine) {
    max-width: 80rem;
}

.jour {
    display: flex;
    flex-direction: column;
    min-width: 0;
    border-radius: 0.5rem;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.jour.aujourdhui {
    outline: 2px solid #1f6f4a;
}

.titre-jour {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.5rem;
    margin: 0;
    padding: 0.5rem 0.625rem;
    border-bottom: 1px solid #e4e7eb;
    font-size: 0.9375rem;
}

.titre-jour .pastille {
    margin: 0;
}

.plage {
    flex: 1;
    padding: 0.5rem 0.625rem;
    border-top: 1px solid #e4e7eb;
    font-size: 0.9375rem;
}

.titre-jour + .plage {
    border-top: 0;
}

.nom-plage {
    display: block;
    color: #52606d;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.plage-vide {
    color: #9aa5b1;
}

.repas-plage {
    margin: 0;
    padding: 0;
    list-style: none;
}

.repas-plage li {
    margin-top: 0.25rem;
    overflow-wrap: anywhere;
}

.repas-libre {
    font-style: italic;
}

/* --- Planification d'un repas --- */
.entete-plage {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.25rem;
}

.bouton-ajout-repas,
.bouton-modifier-repas {
    flex: none;
    min-width: 1.75rem;
    min-height: 1.75rem;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 0.375rem;
    background: transparent;
    color: #1f6f4a;
    font: inherit;
    line-height: 1;
    cursor: pointer;
}

.bouton-ajout-repas {
    font-size: 1.25rem;
    font-weight: 600;
}

.bouton-ajout-repas:hover,
.bouton-ajout-repas:focus-visible,
.bouton-modifier-repas:hover,
.bouton-modifier-repas:focus-visible {
    border-color: #9aa5b1;
    background: #f0f4f8;
}

.repas-plage li {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.25rem;
}

.contenu-repas {
    min-width: 0;
}

.fond-panneau {
    position: fixed;
    inset: 0;
    z-index: 10;
    background: rgba(31, 41, 51, 0.45);
}

.panneau {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 11;
    width: min(32rem, calc(100vw - 2rem));
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    padding: 1.25rem 1.5rem;
    border-radius: 0.5rem;
    background: #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    transform: translate(-50%, -50%);
}

.panneau h2 {
    margin: 0;
    font-size: 1.25rem;
}

.panneau > .aide:first-of-type {
    margin-top: 0.25rem;
}

.choix-mode {
    display: flex;
    margin: 0.75rem 0 1rem;
    border: 1px solid #9aa5b1;
    border-radius: 0.375rem;
    overflow: hidden;
}

.choix-mode button {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 0;
    background: #fff;
    font: inherit;
    cursor: pointer;
}

.choix-mode button + button {
    border-left: 1px solid #9aa5b1;
}

.choix-mode button.actif {
    background: #1f6f4a;
    color: #fff;
    font-weight: 600;
}

.recette-choisie {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem 0.75rem;
    margin-bottom: 1rem;
    padding: 0.625rem 0.75rem;
    border-radius: 0.375rem;
    background: #e3f5ea;
}

.champ-portions {
    width: 4.5rem;
    text-align: center;
}

.suggestions-rapides {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin: -0.5rem 0 1rem;
}

.bouton-mini {
    padding: 0.25rem 0.625rem;
    font-size: 0.875rem;
}

.deplacement {
    padding-top: 0.75rem;
    border-top: 1px solid #e4e7eb;
}

.actions-panneau {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    margin-top: 0.5rem;
}

.bouton-retirer {
    margin-left: auto;
    color: #8a1c13;
}

.confirmation-retrait {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    margin-left: auto;
}

.bouton-danger {
    padding: 0.5rem 0.875rem;
    border: 0;
    border-radius: 0.375rem;
    background: #b42318;
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.bouton-danger:disabled {
    opacity: 0.6;
    cursor: default;
}

/* Plus précis que « .champ input » (pleine largeur) : le champ des portions reste étroit, entre − et +. */
.champ .selecteur-portions input.champ-portions {
    flex: none;
    width: 4.5rem;
    margin: 0;
}

.panneau .selecteur-portions {
    flex-wrap: nowrap;
    margin-bottom: 0;
}

/* --- Calendrier sur cellulaire et petite tablette : les jours s'empilent --- */
@media (max-width: 56rem) {
    .grille-semaine {
        grid-template-columns: 1fr;
        grid-template-rows: none;
        gap: 0.5rem;
    }

    /* Chaque jour redevient une carte autonome : titre sur toute la largeur, dîner et souper côte à côte. */
    .grille-semaine .jour {
        grid-row: auto;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto;
    }

    .grille-semaine .titre-jour {
        grid-column: 1 / -1;
    }

    .grille-semaine .plage {
        border-top: 0;
    }

    .grille-semaine .plage + .plage {
        border-left: 1px solid #e4e7eb;
    }

    /* Cibles tactiles plus grandes. */
    .bouton-ajout-repas,
    .bouton-modifier-repas {
        min-width: 2.5rem;
        min-height: 2.5rem;
        border-color: #cbd2d9;
    }

    .repas-plage li {
        align-items: center;
    }
}

/* Très étroit : dîner et souper l'un sous l'autre dans la carte du jour. */
@media (max-width: 22rem) {
    .grille-semaine .jour {
        grid-template-columns: 1fr;
    }

    .grille-semaine .plage + .plage {
        border-top: 1px solid #e4e7eb;
        border-left: 0;
    }
}

@media (max-width: 30rem) {
    /* Les flèches suffisent ; le titre de la semaine garde la place. */
    .texte-navigation {
        display: none;
    }

    .navigation-semaine .bouton-secondaire {
        min-width: 2.75rem;
        text-align: center;
    }

    .titre-semaine h2 {
        font-size: 1rem;
    }

    /* Le panneau s'ouvre en bas de l'écran, à portée du pouce. */
    .panneau {
        top: auto;
        bottom: 0;
        left: 0;
        width: 100%;
        max-height: 90vh;
        border-radius: 0.75rem 0.75rem 0 0;
        transform: none;
    }

    .actions-panneau .bouton-principal {
        flex: 1;
    }
}

/* Le nombre de portions (ou la catégorie) d'une suggestion ne se coupe pas : c'est le nom qui passe à la ligne. */
.suggestions button .details-ligne {
    flex: none;
    white-space: nowrap;
}

/* Tablette : deux jours par rangée. */
@media (min-width: 36rem) and (max-width: 56rem) {
    .grille-semaine {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* --- Liste d'épicerie --- */
.entete-liste h2 {
    margin-bottom: 0.25rem;
}

.entete-liste .aide {
    margin-top: 0;
}

.liste-cartes.articles-liste li {
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: baseline;
}

.quantite-article {
    flex: none;
    width: 7rem;
    font-weight: 600;
    text-align: right;
    white-space: nowrap;
}

.articles-liste .pastille {
    margin-left: 0.375rem;
}

.article-alerte {
    background: #fffbea;
}

.texte-alerte {
    color: #8d5b00;
    font-size: 0.875rem;
}

@media (max-width: 30rem) {
    .quantite-article {
        width: 5.5rem;
    }
}

.regeneration {
    margin-top: 0;
    margin-bottom: 1rem;
    padding: 0.75rem 1.25rem;
}

.regeneration summary {
    font-weight: 600;
    cursor: pointer;
}

.regeneration[open] summary {
    margin-bottom: 0.5rem;
}

.suggestions-rapides:first-child,
.aide + .suggestions-rapides {
    margin-top: 0.5rem;
}

.ajout-article {
    margin-top: 0;
    margin-bottom: 1rem;
}

.ajout-article .titre-creation {
    margin-top: 0;
    font-weight: 600;
}

.bouton-retirer-article {
    flex: none;
    margin-left: auto;
    align-self: center;
}

/* --- Liste par catégorie --- */
.categorie-liste {
    margin-bottom: 1rem;
}

.titre-categorie {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1.25rem 0 0.375rem;
    color: #1f6f4a;
    font-size: 1rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.compte-categorie {
    padding: 0 0.5rem;
    border-radius: 999px;
    background: #e3f5ea;
    color: #14532d;
    font-size: 0.8125rem;
    letter-spacing: 0;
    text-transform: none;
}

.categorie-liste .liste-cartes {
    margin-top: 0;
}

.resume-alertes {
    margin: 0 0 1rem;
    padding: 0.625rem 0.75rem;
    border-radius: 0.375rem;
    background: #fffbea;
    color: #8d5b00;
}

.article-coche .quantite-article,
.article-coche .nom-ligne {
    color: #7b8794;
    text-decoration: line-through;
}

/* --- Mode magasin : un écran pour le pouce --- */
.entete-magasin {
    position: sticky;
    top: 0;
    z-index: 5;
    margin: -1rem -1rem 0.75rem;
    padding: 0.75rem 1rem 0.5rem;
    background: #f5f7f9;
    box-shadow: 0 1px 0 #e4e7eb;
}

.retour-magasin {
    display: inline-block;
    padding: 0.25rem 0;
}

.progression-magasin {
    margin: 0.25rem 0;
    font-size: 1.0625rem;
}

.barre-magasin {
    width: 100%;
    height: 0.5rem;
    accent-color: #1f6f4a;
}

.rayon {
    margin-bottom: 0.75rem;
    border-radius: 0.5rem;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.titre-rayon {
    margin: 0;
    font-size: 1rem;
}

.entete-rayon {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    min-height: 3rem;
    padding: 0.625rem 1rem;
    border: 0;
    background: #e3f5ea;
    color: #14532d;
    font: inherit;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.rayon-termine .entete-rayon {
    background: #f0f4f8;
    color: #52606d;
}

.nom-rayon {
    flex: 1;
}

.compte-rayon {
    font-weight: 500;
}

.articles-magasin {
    margin: 0;
    padding: 0;
    list-style: none;
}

.articles-magasin li + li {
    border-top: 1px solid #e4e7eb;
}

/* Toute la ligne est la cible : un pouce n'a pas à viser la case. */
.ligne-magasin {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    min-height: 3.5rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
}

.case-magasin {
    flex: none;
    width: 1.75rem;
    height: 1.75rem;
    margin: 0;
    accent-color: #1f6f4a;
    cursor: pointer;
}

.texte-magasin {
    display: flex;
    flex: 1;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    min-width: 0;
}

.nom-magasin {
    font-size: 1.125rem;
    overflow-wrap: anywhere;
}

.quantite-magasin {
    flex: none;
    font-weight: 600;
    white-space: nowrap;
}

.alerte-magasin {
    margin-left: 0.25rem;
    color: #8d5b00;
}

.dans-panier .ligne-magasin {
    background: #f9fafb;
}

.dans-panier .nom-magasin,
.dans-panier .quantite-magasin {
    color: #9aa5b1;
    text-decoration: line-through;
}

.activite-magasin {
    margin: 0.375rem 0 0;
    color: #1f6f4a;
    font-size: 0.9375rem;
}

/* --- Terminer la liste --- */
.terminaison {
    margin-top: 1.5rem;
    padding: 0.75rem 1.25rem;
}

.terminaison summary {
    font-weight: 600;
    cursor: pointer;
}

.terminaison[open] summary {
    margin-bottom: 0.5rem;
}

.choix-reports {
    margin-bottom: 0.5rem;
}

.liste-reports {
    margin: 0 0 1rem;
    padding: 0;
    list-style: none;
}

.liste-reports .champ-case {
    margin-bottom: 0.5rem;
}

.liste-reports .details-ligne {
    margin-left: 0.375rem;
}

.fin-courses {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
}

.fin-courses p {
    margin: 0;
}

.lien-fin-courses {
    margin: 1.5rem 0;
    text-align: center;
}
