.tm-file-thumb {
    transition: opacity .15s ease;
}

.tm-file-thumb:hover {
    opacity: .85;
}

/* Document preview modal (docx / spreadsheets / markdown / plain text). */

.tm-preview-shell {
    height: 550px;
    overflow: auto;
    background: #e9ecef;
}

.tm-preview-state {
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem 1.5rem;
    background: #fff;
}

.tm-preview-body {
    padding: 1rem;
}

.tm-doc-page {
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .12);
    padding: 2rem 2.25rem;
    color: #212529;
    font-size: .95rem;
    line-height: 1.7;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

.tm-doc-page > *:first-child {
    margin-top: 0;
}

.tm-doc-page > *:last-child {
    margin-bottom: 0;
}

.tm-doc-page h1 { font-size: 1.5rem; }
.tm-doc-page h2 { font-size: 1.3rem; }
.tm-doc-page h3 { font-size: 1.15rem; }
.tm-doc-page h4,
.tm-doc-page h5,
.tm-doc-page h6 { font-size: 1rem; }

.tm-doc-page h1,
.tm-doc-page h2,
.tm-doc-page h3,
.tm-doc-page h4,
.tm-doc-page h5,
.tm-doc-page h6 {
    font-weight: 600;
    margin: 1.4em 0 .6em;
}

.tm-doc-page img {
    max-width: 100%;
    height: auto;
}

.tm-doc-page table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.tm-doc-page table td,
.tm-doc-page table th {
    border: 1px solid #dee2e6;
    padding: .4rem .6rem;
    vertical-align: top;
}

.tm-doc-page blockquote {
    border-left: 3px solid #dee2e6;
    margin: 1rem 0;
    padding: .25rem 0 .25rem 1rem;
    color: #6c757d;
}

.tm-doc-page pre {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: .75rem 1rem;
    overflow-x: auto;
}

.tm-doc-page code {
    background: #f1f3f5;
    border-radius: 3px;
    padding: .1rem .3rem;
    font-size: .875em;
}

.tm-doc-page pre code {
    background: none;
    padding: 0;
}

.tm-text-page {
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .12);
    padding: 1.25rem 1.5rem;
    margin: 0;
    font-size: .85rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: #212529;
}

.tm-sheet-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    padding: 0 1rem;
    margin-bottom: -.25rem;
}

.tm-sheet-tab {
    border: 1px solid #ced4da;
    border-bottom: none;
    background: #f1f3f5;
    border-radius: 6px 6px 0 0;
    padding: .3rem .75rem;
    font-size: .8rem;
    color: #495057;
    line-height: 1.2;
}

.tm-sheet-tab.active {
    background: #fff;
    color: #0d6efd;
    font-weight: 600;
}

.tm-sheet-pane {
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .12);
    margin: 1rem;
    overflow-x: auto;
}

.tm-sheet-pane table {
    border-collapse: collapse;
    font-size: .82rem;
    color: #212529;
    width: 100%;
}

.tm-sheet-pane td,
.tm-sheet-pane th {
    border: 1px solid #dee2e6;
    padding: .35rem .55rem;
    vertical-align: top;
    text-align: left;
}

.tm-sheet-pane .tm-cell {
    min-width: 70px;
    max-width: 320px;
    max-height: 7.5em;
    overflow: auto;
    overflow-wrap: anywhere;
}

.tm-sheet-pane tr:first-child td,
.tm-sheet-pane tr:first-child th {
    background: #f8f9fa;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 1;
}

@media (max-width: 575.98px) {
    .tm-preview-shell {
        height: 70vh;
    }

    .tm-doc-page {
        padding: 1.25rem;
    }
}
