.saw-file-viewer { width:min(1100px,calc(100vw - 24px)); max-width:calc(100vw - 24px); height:min(850px,calc(100dvh - 32px)); max-height:calc(100dvh - 32px); padding:0; border:1px solid #ddd7d1; border-radius:20px; background:#f8f7f2; color:#282332; box-shadow:0 30px 100px #0005; }
.saw-file-viewer::backdrop { background:#1e182bc9; }
.saw-file-viewer[open] { display:flex; flex-direction:column; }
.saw-file-viewer header { display:flex; align-items:center; justify-content:space-between; gap:20px; padding:20px 24px; background:#fff; border-bottom:1px solid #e6e0d9; }
.saw-file-viewer h2 { font:700 18px/1.4 system-ui,sans-serif; margin:0; overflow-wrap:anywhere; min-width:0; }
.saw-file-viewer button { border:1px solid #cfc6be; border-radius:10px; background:#fff; color:#282332; padding:10px 16px; font:700 14px system-ui,sans-serif; cursor:pointer; }
.saw-file-viewer button:focus-visible { outline:3px solid #c65d42; outline-offset:3px; }
.saw-file-viewer button:disabled { opacity:.45; cursor:default; }
.saw-file-viewer .viewer-save { background:#282332; border-color:#282332; color:#fff; }
.viewer-actions,.viewer-pages { display:flex; align-items:center; justify-content:center; gap:10px; flex-shrink:0; }
.viewer-body { flex:1; overflow:auto; padding:24px; min-height:0; text-align:center; }
.viewer-body>img,.viewer-body>video { display:block; max-width:100%; max-height:calc(100dvh - 210px); width:auto; height:auto; margin:auto; object-fit:contain; border-radius:8px; }
.viewer-body>audio { width:min(600px,100%); margin:50px auto 20px; }
.viewer-body canvas { display:block; max-width:100%; height:auto; margin:20px auto; background:#fff; box-shadow:0 4px 22px #28233220; }
.viewer-text { text-align:left; white-space:pre-wrap; overflow-wrap:anywhere; background:white; padding:24px; border:1px solid #e6e0d9; border-radius:12px; color:#282332; font:14px/1.65 ui-monospace,monospace; }
.viewer-message { margin:18px auto; color:#5d5465; font-size:14px; max-width:650px; }
.viewer-document { background:white; margin:20px auto; padding:28px; border:1px solid #e6e0d9; border-radius:12px; text-align:left; font:16px/1.65 system-ui,sans-serif; overflow-wrap:anywhere; }
.viewer-document p { white-space:pre-wrap; margin:0 0 12px; }
.viewer-document h1,.viewer-document h2,.viewer-document h3 { margin:20px 0 12px; color:#282332; }
.viewer-table-scroll { max-width:100%; overflow:auto; }
.viewer-document table { border-collapse:collapse; font-size:14px; min-width:100%; }
.viewer-document td,.viewer-document th { border:1px solid #ded8d0; padding:8px 12px; min-width:70px; max-width:350px; vertical-align:top; }
.viewer-document th { background:#f0ede7; }
.viewer-pages select { max-width:70%; border:1px solid #bdb2aa; padding:10px; border-radius:8px; background:#fff; color:#282332; }
@media(max-width:600px) { .viewer-document { padding:14px; } }
@media(max-width:600px) { .saw-file-viewer header { padding:16px; flex-wrap:wrap; gap:12px; } .viewer-actions { width:100%; justify-content:flex-end; } .viewer-body { padding:12px; } .viewer-text { padding:14px; } }
