/* File viewer (components/file-viewer.js, fix 2026-10-16): a PDF or image opened over the page instead of a download.
   Same backdrop and surface as the modals; the file fills the space under a 48px head. */
.fv-backdrop { position: fixed; inset: 0; z-index: var(--z-modal); background: var(--backdrop); display: flex;
  align-items: stretch; justify-content: center; padding: var(--sp-6); box-sizing: border-box; }
.fv { background: var(--bg-surface); box-shadow: var(--shadow-modal); border-radius: var(--r-lg); display: flex;
  flex-direction: column; width: min(1100px, 100%); min-width: 0; overflow: hidden; }
.fv-head { display: flex; align-items: center; gap: var(--sp-4); flex: none; height: var(--modal-head-h);
  padding: 0 var(--sp-5) 0 var(--sp-6); border-bottom: 1px solid var(--border); min-width: 0; }
.fv-name { margin: 0; flex: 1 1 auto; min-width: 0; font-size: var(--fs-lg); font-weight: var(--fw-semibold);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fv-pages { flex: none; font-size: var(--fs-sm); color: var(--text-2); }
.fv-acts { display: flex; align-items: center; gap: var(--sp-3); flex: none; }
.fv-acts .btn { display: inline-flex; align-items: center; gap: var(--sp-2); text-decoration: none; }
.fv-acts .ic, .fv-acts .ic svg { width: 14px; height: 14px; }
.fv-body { flex: 1 1 auto; min-height: 0; background: var(--bg-app); display: flex; }
.fv-frame { flex: 1; width: 100%; height: 100%; border: 0; background: var(--bg-surface); }
.fv-img-wrap { flex: 1; display: grid; place-items: center; overflow: auto; padding: var(--sp-5); }
.fv-img { max-width: 100%; max-height: 100%; object-fit: contain; box-shadow: var(--shadow-raised); }
@media (max-width: 720px) {
  .fv-backdrop { padding: 0; }
  .fv { border-radius: 0; }
  .fv-head { padding: 0 var(--sp-4); gap: var(--sp-3); }
  .fv-pages, .fv-acts .fv-btn-text { display: none; }
}
/* The small download icon next to a file name that now opens the viewer. */
.file-dl { display: inline-grid; place-items: center; width: 22px; height: 22px; flex: none; border-radius: var(--r-sm);
  color: var(--text-2); vertical-align: middle; margin-left: var(--sp-2); }
.file-dl:hover { background: var(--bg-hover); color: var(--text); }
.file-dl .ic, .file-dl .ic svg { width: 14px; height: 14px; }
