/* Pièces jointes cumulées (contrôleur attachments) : liste des fichiers choisis, total, refus. */

.attachments__list {
    display: grid;
    gap: var(--space-2);
    margin-top: var(--space-3);
}

.attachments__item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
    background: var(--surface-muted);
    border: var(--border-width) solid var(--border-default);
    border-radius: var(--radius-sm);
}

.attachments__item > svg {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
}

.attachments__name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attachments__size {
    font: var(--type-body-sm);
    color: var(--text-secondary);
    white-space: nowrap;
}

.attachments__remove {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-2);
    font: var(--type-body-sm);
    font-weight: var(--weight-semibold);
    color: var(--text-link);
    background: none;
    border: 0;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.attachments__remove:hover {
    color: var(--text-link-hover);
}

.attachments__remove svg {
    width: 16px;
    height: 16px;
}

.attachments__summary:not(:empty) {
    margin-top: var(--space-2);
    font: var(--type-body-sm);
    color: var(--text-secondary);
}

.attachments__refused {
    margin-top: var(--space-2);
    font: var(--type-body-sm);
    color: var(--status-error);
}

/* Petits écrans : le bouton « Retirer » ne garde que son icône */
@media (max-width: 399px) {
    .attachments__remove span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }
}
