/* Document cards: the file's first page drawn inside the card, with the name on a blurred band
 * that fades up into the page. Applies to PDF, Office and text attachments in messages, the
 * inline editor and the composer strip. */
.message-attachment-card.has-document-preview,
.edit-attachment-card.has-document-preview {
    height: 188px;
    min-height: 188px;
}
.attachment-strip-card.has-document-preview,
.message-attachment-card.has-document-preview,
.edit-attachment-card.has-document-preview {
    cursor: pointer;
    border-color: rgba(255, 255, 255, 0.14);
}
.attachment-document-preview {
    position: absolute;
    inset: 0;
    overflow: hidden;
    background: #fff;
    color: #1d1d22;
    pointer-events: none;
}
.attachment-document-preview img,
.attachment-document-preview canvas {
    display: block;
    width: 100%;
    height: auto;
    min-height: 100%;
    object-fit: cover;
    object-position: top center;
}
.attachment-document-preview .document-page {
    width: 100%;
    min-height: 100%;
    box-sizing: border-box;
    padding: 16px 16px 44px;
    font: 11px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    color: #2c2c31;
    word-break: break-word;
    text-align: left;
}
.attachment-document-preview .document-page h4 {
    margin: 0 0 8px;
    font-size: 15px;
    line-height: 1.25;
    font-weight: 700;
    color: #111114;
}
.attachment-document-preview .document-page p {
    margin: 0 0 6px;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: pre-line;
}
.attachment-document-preview .document-page-slide {
    min-height: 0;
    aspect-ratio: 16 / 9;
    padding: 14px 16px;
}
.attachment-document-preview .document-page-slide h4 {
    font-size: 17px;
}
.attachment-document-preview .document-page-slide p::before {
    content: "•  ";
    color: #7a7a82;
}
.attachment-document-preview table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 10px;
}
.attachment-document-preview th,
.attachment-document-preview td {
    border: 1px solid #e1e1e6;
    padding: 4px 6px;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #2c2c31;
}
.attachment-document-preview th {
    background: #f1f1f4;
    color: #111114;
    font-weight: 700;
}
/* Paper lines stand in until the page has been drawn (or when it cannot be). */
.document-paper {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 18px;
}
.document-paper i {
    display: block;
    height: 5px;
    border-radius: 3px;
    background: #dedee2;
}
.document-paper i:nth-child(1) { height: 8px; width: 50%; margin-bottom: 3px; background: #d4d4d9; }
.document-paper i:nth-child(2) { width: 78%; }
.document-paper i:nth-child(3) { width: 64%; }
.document-paper i:nth-child(4) { width: 72%; }
.document-paper i:nth-child(5) { width: 56%; }
.document-paper i:nth-child(6) { width: 74%; }
.document-paper i:nth-child(7) { width: 60%; }
.document-paper i:nth-child(8) { width: 48%; }
.attachment-strip-card .document-paper { padding: 12px; gap: 5px; }
.attachment-strip-card .document-paper i { height: 4px; }
.attachment-strip-card .document-paper i:nth-child(1) { height: 6px; }
.attachment-strip-card .document-paper i:nth-child(n+5) { display: none; }
/* The name band: blurred page beneath, fading up, generously padded. */
.attachment-strip-overlay.is-document-overlay {
    padding: 30px 14px 13px;
    background: linear-gradient(180deg, rgba(10, 10, 12, 0) 0%, rgba(10, 10, 12, 0.74) 34%, rgba(10, 10, 12, 0.92) 100%);
    -webkit-backdrop-filter: blur(14px) saturate(1.05);
    backdrop-filter: blur(14px) saturate(1.05);
    -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 30%);
    mask-image: linear-gradient(180deg, transparent 0, #000 30%);
}
.attachment-strip-card .attachment-strip-overlay.is-document-overlay {
    padding: 20px 10px 9px;
}
.attachment-strip-overlay.is-document-overlay .attachment-strip-meta {
    margin-top: 0;
    gap: 3px;
}
.attachment-strip-overlay.is-document-overlay .attachment-strip-name {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
}
.attachment-strip-card .attachment-strip-overlay.is-document-overlay .attachment-strip-name {
    font-size: 11px;
    -webkit-line-clamp: 1;
}
.attachment-strip-overlay.is-document-overlay .attachment-strip-size {
    color: rgba(255, 255, 255, 0.76);
    font-weight: 500;
    letter-spacing: 0.01em;
}
