.sup-attach {
    margin-top: var(--s-2);
    padding: var(--s-2);
    border: 1px dashed var(--border);
    border-radius: var(--r-sm);
    transition: border-color 140ms ease, background 140ms ease;
}

.sup-attach.is-drag {
    border-color: var(--accent);
    background: var(--accent-tint);
}

.sup-attach-preview {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-2);
    margin-bottom: var(--s-2);
}

.sup-attach-item {
    position: relative;
    width: 84px;
    height: 84px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--surface-2);
}

.sup-attach-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.sup-attach-remove {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.78);
    color: #fff;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
}

.sup-attach-remove:hover {
    background: var(--danger);
}

.sup-attach-actions {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    flex-wrap: wrap;
}

.sup-attach-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    padding: 4px 10px;
    border: 1px solid var(--border-strong);
    border-radius: var(--r-sm);
    background: transparent;
    color: var(--text-main);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.sup-attach-btn:hover {
    background: var(--surface-hover);
    border-color: var(--border-hover);
}

.sup-attach-btn:focus-visible {
    outline: 2px solid var(--accent-line);
    outline-offset: 2px;
}

.sup-attach-hint {
    color: var(--text-dim);
    font-size: 11px;
    line-height: 1.4;
}

.sup-attach-error {
    margin-top: 4px;
    color: var(--danger);
    font-size: 12px;
    line-height: 1.4;
}

.sup-msg-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-2);
    margin-top: var(--s-2);
}

.sup-msg-attachments a {
    display: block;
    width: 112px;
    height: 112px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--surface-2);
}

.sup-msg-attachments img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 160ms ease;
}

.sup-msg-attachments a:hover img {
    transform: scale(1.03);
}

@media (max-width: 575.98px) {
    .sup-msg-attachments a {
        width: 88px;
        height: 88px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sup-msg-attachments img {
        transition: none;
    }
}
