/* The window of a file on the Files page (js/filesheet.js, js/filepreview.js): a frame for the preview and what goes in it (the pages of a PDF with their pager, the start of a text, a table, what an archive
   holds, a player), and the words under it. Colours are Orbita's. The frame of a PDF has the shape of the page before the page arrives, so the window does not jump about. */
.fsheet .sheet-head h2 { overflow-wrap: anywhere; }
.fmeta { display: grid; gap: 2px; padding: 0 4px; }
.fmeta p { margin: 0; overflow-wrap: anywhere; }
.fprev { min-width: 0; padding: 10px; border-radius: 20px; background: var(--field); box-shadow: inset 0 0 0 1px var(--line); }
.fprev-body, .fprev-pages, .fprev-col, .fprev-sheet { display: grid; gap: 10px; min-width: 0; }
.fprev-sk { width: 100%; height: 190px; border-radius: 14px; }
.fprev-stage { display: flex; justify-content: center; min-width: 0; }
.fprev-frame { display: block; position: relative; padding: 0; border: 0; border-radius: 6px; overflow: hidden; cursor: zoom-in; box-shadow: 0 0 0 1px var(--line2), var(--sh1); color: inherit;
  --maxh: min(52vh, 540px); width: min(100%, calc(var(--maxh) / var(--ratio, 1.414))); aspect-ratio: 1 / var(--ratio, 1.414); }
.fprev-frame:not(.sk) { background: transparent; }
@supports not (aspect-ratio: 1 / 1) {                                  /* an older web view: the height comes from the width by padding, the picture lies over it */
  .fprev-frame:not(.fprev-free)::before { content: ""; display: block; padding-top: calc(var(--ratio, 1.414) * 100%); }
  .fprev-frame:not(.fprev-free) .fprev-page { position: absolute; left: 0; top: 0; }
}
.fprev-frame.fprev-free { width: auto; max-width: 100%; aspect-ratio: auto; min-width: 120px; min-height: 120px; display: grid; place-items: center; }
.fprev-frame:disabled { cursor: default; }
.fprev-page, .fprev-image { display: block; opacity: 0; transition: opacity .18s var(--ease); }
.fprev-page { width: 100%; height: 100%; object-fit: contain; }
.fprev-image { max-width: 100%; max-height: var(--maxh); object-fit: contain; }
.fprev-page.ready, .fprev-image.ready { opacity: 1; }
.fprev-pager { display: flex; align-items: center; justify-content: center; gap: 12px; }
.fprev-count { min-width: 8.5em; text-align: center; font-variant-numeric: tabular-nums; }
.fprev-fail, .fprev-none { display: grid; gap: 10px; justify-items: center; text-align: center; padding: 18px 8px; }
.fprev-fail p, .fprev-none p { margin: 0; overflow-wrap: anywhere; }
.fprev-tile { width: 52px; height: 52px; border-radius: 16px; }
.fprev-scroll { max-height: min(46vh, 420px); overflow: auto; border-radius: 14px; min-width: 0; }
.fprev-text { margin: 0; padding: 4px; white-space: pre-wrap; overflow-wrap: anywhere; font: 400 14px/1.55 var(--f); color: var(--tx); }
.fprev-text.code { font: 400 13px/1.55 var(--m); }
.fprev-md { padding: 4px 6px; }
.fprev-note { margin: 0; padding: 0 2px; }
.fprev-sheet h3 { margin: 0 4px; }
.fprev-table { border-collapse: collapse; width: max-content; min-width: 100%; font-size: 14px; }
.fprev-table th, .fprev-table td { padding: 7px 10px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; max-width: 22em; overflow-wrap: anywhere; }
.fprev-table th { background: var(--surf2); font-weight: 700; white-space: nowrap; }
.fprev-table tr:last-child td { border-bottom: 0; }
.fprev-list { list-style: none; margin: 0; padding: 0; display: grid; }
.fprev-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 7px 10px; border-bottom: 1px solid var(--line); }
.fprev-list li:last-child { border-bottom: 0; }
.fprev-name { min-width: 0; font-size: 13px; line-height: 18px; overflow-wrap: anywhere; }
.fprev-size { flex: none; white-space: nowrap; font-variant-numeric: tabular-nums; }
.fprev-media { display: grid; justify-items: center; gap: 8px; min-width: 0; }
.fprev-media p { margin: 0; text-align: center; padding: 14px 6px; }
.fprev-player { width: 100%; max-height: min(46vh, 420px); border-radius: 12px; }
@media (prefers-reduced-motion: reduce) { .fprev-page, .fprev-image { transition: none; } }
