/* Expanded message: body, image notice, attachments. */

.message-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message-content__body {
    max-height: 70vh;
    overflow: auto;
    padding: 16px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    background: var(--bg-page);
    color: var(--text-primary);
    overflow-wrap: anywhere;
}

/* HTML mail is authored for white backgrounds; keep it on paper in both themes */
.message-html-content {
    color-scheme: light;
    background: #ffffff;
    color: #18181b;
}

.message-content__body img {
    max-width: 100%;
    height: auto;
}

.message-content__body pre {
    margin: 0;
    white-space: pre-wrap;
    font-family: var(--font-mono);
    font-size: 13px;
}

.traffic-friendly-notice {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: var(--bg-subtle);
    color: var(--text-secondary);
    font-size: 13px;
}

.traffic-friendly-notice strong {
    color: var(--text-primary);
    font-weight: 500;
}

.traffic-friendly-notice button {
    height: 30px;
    font-size: 13px;
}

.attachments-section h3 {
    margin-bottom: 8px;
    color: var(--text-tertiary);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.attachments-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.attachment-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
}

.attachment-icon {
    display: flex;
    color: var(--text-tertiary);
}

.attachment-info {
    flex: 1 1 140px;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.attachment-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.attachment-size {
    white-space: nowrap;
    color: var(--text-tertiary);
    font-size: 12px;
}

.attachment-actions {
    display: flex;
    gap: 4px;
    margin-inline-start: auto;
}

.attachment-actions .btn {
    height: 30px;
    padding: 0 10px;
    font-size: 12px;
}

.attachment-preview {
    flex-basis: 100%;
}

.attachment-preview img {
    max-width: 100%;
    border-radius: 6px;
}

.message-content__actions {
    display: flex;
    justify-content: flex-end;
}
