/* file.file's data view and list view, and the viewers the data view mounts
   (static/viewer/). The show-record frame around the data view is
   engy/engy.css's; the view's own min size is its dashboard.data-view row. */

.file-file-view {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    height: 100%;
}

.file-file-head {
    display: flex;
    align-items: baseline;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.file-file-head button {
    margin-left: auto;
}

.file-file-name {
    font-weight: 600;
}

/* The viewer, not the dialog, decides how its content scrolls: an image and
   a PDF fit the box, text and markdown scroll inside it. */
.file-file-viewer {
    flex: 1;
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--color-line);
    border-radius: 6px;
    overflow: hidden;
}

.file-viewer-image {
    flex: 1;
    min-height: 0;
    width: 100%;
    object-fit: contain;
}

.file-viewer-pdf {
    flex: 1;
    min-height: 0;
    width: 100%;
    border: none;
}

.file-viewer-text,
.file-viewer-markdown {
    flex: 1;
    min-height: 0;
    overflow: auto;
    margin: 0;
    padding: var(--space-lg);
}

.file-viewer-text {
    white-space: pre-wrap;
    word-break: break-word;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: var(--text-md);
}

.file-viewer-markdown {
    line-height: 1.55;
}

.files-list-thumb {
    width: 2.4rem;
    text-align: center;
}

.files-list-kind {
    display: inline-block;
    min-width: 2.2rem;
    padding: var(--space-xs) var(--space-xs);
    border: 1px solid var(--color-line);
    border-radius: 3px;
    font-size: var(--text-xs);
    text-transform: uppercase;
    color: var(--color-accent);
}

.files-list-name {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: var(--color-accent);
    cursor: pointer;
    text-align: left;
}
