.file-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.file-chip {
    max-width: 180px;
    padding: 4px 8px;
    border-radius: 999px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--muted);
    background: #eef2f7;
    font-size: 12px;
}

.file-viewer-modal {
    width: min(980px, 100%);
}

.file-viewer-body {
    min-height: 360px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #f8fafc;
    overflow: hidden;
}

.file-viewer-body iframe,
.file-viewer-body img,
.file-viewer-body video {
    display: block;
    width: 100%;
    min-height: 62vh;
    border: 0;
}

.file-viewer-body video {
    max-height: 72vh;
    background: #0f172a;
}

.existing-files {
    display: grid;
    gap: 7px;
    margin-top: 8px;
    color: var(--muted);
    font-size: 12px;
}

.existing-files strong {
    width: 100%;
    color: var(--ink);
}

.existing-file-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 6px;
    align-items: center;
    padding: 7px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #f8fafc;
}

.existing-file-row span {
    min-width: 0;
    padding: 4px 8px;
    border-radius: 999px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    background: #eef2f7;
}

.file-viewer-body img {
    height: auto;
    max-height: 72vh;
    object-fit: contain;
    background: #0f172a;
}

.file-viewer-message {
    padding: 28px;
    color: var(--muted);
}

.file-viewer-text {
    min-height: 62vh;
    margin: 0;
    padding: 18px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--ink);
    background: #fff;
}

.file-preview-document {
    min-height: 62vh;
    max-height: 72vh;
    overflow: auto;
    padding: 22px 26px;
    color: var(--ink);
    background: #fff;
    line-height: 1.65;
}

.file-preview-document p {
    margin: 0 0 10px;
}

.file-preview-slide {
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}

.file-preview-slide h4 {
    margin: 0 0 8px;
    color: var(--primary);
}

.file-preview-scroll {
    max-height: 72vh;
    overflow: auto;
    background: #fff;
}

.file-preview-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    color: var(--ink);
    font-size: 13px;
}

.file-preview-table td {
    min-width: 110px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    vertical-align: top;
}

.file-preview-note {
    padding: 10px 14px;
    color: var(--muted);
    background: #f8fafc;
    border-top: 1px solid var(--line);
    font-size: 12px;
}
