/* Rustine — un fichier, un message d'erreur, une correction prouvée.
 * Fond #0d0f11, accent orange (var(--accent) = #f7931a), design maison. */

.rustine {
    margin: .2rem 0 1.1rem;
    padding: 1rem 1.05rem 1.05rem;
    border: 1px solid var(--border-accent);
    border-radius: 14px;
    background:
        radial-gradient(120% 140% at 100% 0%, rgba(247, 147, 26, .08), transparent 60%),
        #0d0f11;
}

.rustine-head { margin-bottom: .8rem; }

.rustine-title {
    display: flex;
    align-items: baseline;
    gap: .55rem;
    flex-wrap: wrap;
    margin: 0 0 .35rem;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -.01em;
}

.rustine-badge { font-size: 1.05em; }

.rustine-sub {
    font-size: .82rem;
    font-weight: 500;
    color: var(--accent);
    letter-spacing: 0;
}

.rustine-p { margin: 0; font-size: .86rem; line-height: 1.5; max-width: 72ch; }

/* Formulaire */
.rustine-form { display: grid; gap: .6rem; }

.rustine-drop {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .25rem;
    min-height: 74px;
    padding: .8rem 1rem;
    border: 1.5px dashed rgba(247, 147, 26, .45);
    border-radius: 10px;
    background: rgba(255, 255, 255, .015);
    cursor: pointer;
    text-align: center;
    transition: border-color .15s, background .15s;
}
.rustine-drop:hover, .rustine-drop-survol { border-color: var(--accent); background: var(--accent-dim); }
.rustine-drop-plein { border-style: solid; border-color: rgba(247, 147, 26, .6); }
.rustine-drop-txt { font-size: .92rem; font-weight: 600; }
.rustine-drop-meta { font-size: .78rem; }

.rustine-form textarea {
    width: 100%;
    resize: vertical;
    padding: .65rem .75rem;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    background: var(--bg-panel);
    color: var(--text);
    font: inherit;
    font-size: .88rem;
    line-height: 1.45;
}
.rustine-form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }

.rustine-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    flex-wrap: wrap;
}
.rustine-check { display: flex; align-items: center; gap: .45rem; font-size: .8rem; color: var(--text-dim, #9a9fa6); cursor: pointer; }
.rustine-check input { accent-color: var(--accent); }

/* État */
.rustine-etat { margin: .7rem 0 0; font-size: .84rem; }
.rustine-etat[hidden] { display: none; }
.rustine-etat-cours { color: var(--accent); }
.rustine-etat-cours::after { content: ' ●'; animation: rustine-clignote 1s steps(2) infinite; }
.rustine-etat-ok { color: var(--ok); }
.rustine-etat-err { color: var(--err); }
@keyframes rustine-clignote { to { opacity: .25; } }

/* Résultat */
.rustine-resultat { margin-top: .85rem; display: grid; gap: .7rem; }
.rustine-resultat[hidden] { display: none; }

.rustine-scores {
    display: flex;
    align-items: center;
    gap: .9rem;
    flex-wrap: wrap;
    padding: .7rem .9rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-panel);
}
.rustine-scores[hidden] { display: none; }
.rustine-score { display: flex; flex-direction: column; min-width: 64px; }
.rustine-score-l { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-dim, #9a9fa6); }
.rustine-score-v { font-family: var(--mono); font-size: 1.25rem; font-weight: 700; }
.rustine-score-fleche { color: var(--text-dim, #9a9fa6); font-size: 1.2rem; }
.rustine-scores-mieux .rustine-score:last-of-type .rustine-score-v { color: var(--ok); }
.rustine-scores-pire .rustine-score:last-of-type .rustine-score-v { color: var(--err); }

.rustine-controles {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: .35rem .6rem;
    flex-basis: 100%;
    font-size: .76rem;
}
.rustine-controle { display: inline-flex; gap: .3rem; padding: .15rem .5rem; border-radius: var(--r-pill); background: rgba(255, 255, 255, .04); }
.rustine-controle-n { color: var(--text-dim, #9a9fa6); }
.rustine-controle-change { background: var(--accent-dim); }
.rustine-controle-av { text-decoration: line-through; opacity: .6; }

.rustine-refus {
    padding: .7rem .9rem;
    border: 1px solid rgba(226, 59, 74, .35);
    border-radius: 10px;
    background: rgba(226, 59, 74, .06);
    font-size: .85rem;
}
.rustine-refus[hidden] { display: none; }
.rustine-refus-t { margin: 0 0 .35rem; font-weight: 600; }
.rustine-refus ul { margin: 0 0 .4rem; padding-left: 1.1rem; }
.rustine-refus p:last-child { margin: 0; }

/* Diff */
.rustine-diff-block[hidden] { display: none; }
.rustine-diff-block pre { max-height: 460px; overflow: auto; }
.rustine-diff-block code { font-family: var(--mono); font-size: .8rem; line-height: 1.5; }
.rustine-l-plus { color: var(--ok); background: rgba(16, 185, 129, .08); display: inline-block; width: 100%; }
.rustine-l-moins { color: var(--err); background: rgba(226, 59, 74, .08); display: inline-block; width: 100%; }
.rustine-l-arobase { color: var(--accent); }
.rustine-l-tete { color: var(--text-dim, #9a9fa6); font-weight: 600; }

.rustine-facture { margin: 0; font-size: .78rem; }

@media (max-width: 560px) {
    .rustine { padding: .85rem .8rem .9rem; }
    .rustine-actions { align-items: stretch; }
    .rustine-actions .btn { width: 100%; }
}
