﻿.attachment-card {
    width: min(100%, 30rem);
    margin: 0;
    border: 1px solid var(--panel-border);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 14px 32px rgba(18, 18, 20, 0.05);
    overflow: hidden;
}

.attachment-summary {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.95rem 1rem;
    cursor: pointer;
    list-style: none;
}

.attachment-summary::-webkit-details-marker {
    display: none;
}

.attachment-icon {
    position: relative;
    width: 38px;
    height: 46px;
    flex: 0 0 auto;
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff 0%, #f3f3f6 100%);
}

.attachment-icon::before {
    content: "";
    position: absolute;
    top: -1px;
    right: -1px;
    width: 15px;
    height: 15px;
    border-top: 1px solid var(--panel-border);
    border-right: 1px solid var(--panel-border);
    border-top-right-radius: 12px;
    background: linear-gradient(135deg, #ececf1 0%, #ffffff 100%);
    clip-path: polygon(0 0, 100% 0, 100% 100%);
}

.attachment-meta {
    display: flex;
    align-items: center;
    min-width: 0;
    text-align: left;
}

.attachment-name {
    font-size: 0.98rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.attachment-toggle {
    margin-left: auto;
    width: 14px;
    height: 14px;
    border-right: 1.5px solid var(--muted);
    border-bottom: 1.5px solid var(--muted);
    transform: rotate(45deg);
    transition: transform 180ms ease;
}

.attachment-card[open] .attachment-toggle {
    transform: rotate(-135deg);
    margin-top: 6px;
}

.attachment-preview {
    padding: 0 1rem 1rem;
    border-top: 1px solid var(--panel-border);
    background: #fafafd;
}

.attachment-preview pre {
    margin: 0;
    max-height: 320px;
    overflow: auto;
    padding: 1rem;
    border: 1px solid var(--panel-border);
    border-radius: 18px;
    background: #ffffff;
    color: var(--text);
    font: inherit;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
}

@media (max-width: 720px) {
    .attachment-card {
        width: min(100%, 100%);
    }
}
