.document-preview-open { overflow: hidden; }
.document-preview {
  width: min(1120px, calc(100vw - 2rem));
  height: min(960px, 92dvh);
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line, #d8dce1);
  border-radius: 14px;
  color: var(--ink, #1e2630);
  background: var(--bg, #fff);
  box-shadow: 0 24px 100px #0006;
}
.document-preview::backdrop { background: #0009; backdrop-filter: blur(5px); }
.document-preview-panel { display: flex; flex-direction: column; width: 100%; height: 100%; }
.document-preview-header { display: flex; flex-shrink: 0; gap: 1rem; align-items: center; justify-content: space-between; padding: .7rem 1rem; border-bottom: 1px solid var(--line, #d8dce1); }
.document-preview-header h2 { margin: 0; overflow: hidden; font: 600 .95rem/1.4 system-ui, sans-serif; text-overflow: ellipsis; white-space: nowrap; }
.document-preview-actions { display: flex; flex-shrink: 0; gap: 1rem; align-items: center; }
.document-preview-actions a, .document-preview-fallback { color: inherit; font: 500 .75rem/1.4 system-ui, sans-serif; text-decoration: none; }
.document-preview-actions a:hover, .document-preview-fallback:hover { text-decoration: underline; }
.document-preview-actions button { display: grid; width: 34px; height: 34px; padding: 0; place-items: center; border: 1px solid var(--line, #d8dce1); border-radius: 50%; color: inherit; background: transparent; font: 400 1.5rem/1 system-ui, sans-serif; cursor: pointer; }
.document-preview-actions button:hover { background: var(--surface-muted, #8882); }
.document-preview :is(a, button):focus-visible { outline: 2px solid var(--link, #397d9b); outline-offset: 3px; }
.document-preview-frame { flex: 1; width: 100%; min-height: 0; border: 0; background: #e4e6e9; }
.document-preview-fallback { align-self: flex-end; padding: .45rem 1rem; }
@media (max-width: 600px) {
  .document-preview { width: calc(100vw - 1rem); height: 94dvh; border-radius: 10px; }
  .document-preview-header { gap: .5rem; padding: .55rem .7rem; }
  .document-preview-actions { gap: .7rem; }
}
