/* The browser and the document viewer use separate dialogs so closing a
   document restores the selected folder and its scroll position. */
.swan-quote-files[hidden],.swan-quote-files [hidden]{display:none!important}
dialog.swan-quote-file-browser{box-sizing:border-box;position:fixed;inset:0;width:100%;height:100%;height:100dvh;max-width:none;max-height:none;margin:0;padding:0;border:0;background:var(--bg,#111);color:var(--text,#f5f5f5);overflow:hidden}
dialog.swan-quote-file-browser[open]{display:flex;flex-direction:column}
.swan-quote-file-browser::backdrop{background:#000}
.swan-quote-browser-header{flex:none;padding:calc(7px + env(safe-area-inset-top)) max(14px,env(safe-area-inset-right)) 9px max(14px,env(safe-area-inset-left));background:var(--panel,#1d1d1d);border-bottom:1px solid var(--line,#444)}
.swan-quote-browser-actions{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:7px}
.swan-quote-browser-actions .btn{min-height:44px;font-weight:700;white-space:nowrap}
.swan-quote-file-path{display:flex;flex-wrap:wrap;align-items:baseline;gap:3px 7px;min-width:0;max-height:24dvh;overflow:auto;margin:0 0 8px;padding:0;list-style:none;color:var(--muted,#b1b1b1);font-size:14px;line-height:1.4;overflow-wrap:anywhere}
.swan-quote-file-path li{min-width:0}
.swan-quote-file-path li+li::before{content:"›";margin-right:7px;color:var(--muted,#b1b1b1)}
.swan-quote-file-path [aria-current]{color:var(--text,#f5f5f5);font-weight:750}
.swan-quote-file-search{margin:0}
.swan-quote-file-search input{box-sizing:border-box;width:100%;min-height:42px;max-width:100%;font-size:16px}
.swan-quote-file-scroll{min-height:0;flex:1;overflow:auto;overscroll-behavior:contain;padding:4px max(14px,env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(14px,env(safe-area-inset-left))}
.swan-quote-file-scroll [role=status]{margin:5px 0 8px;font-size:13px}
.swan-quote-file-list{padding:0;margin:0 0 10px;list-style:none}
.swan-quote-file-item{display:grid;grid-template-columns:65px minmax(0,1fr) auto;gap:10px;align-items:center;width:100%;padding:12px 10px;border:0;border-bottom:1px solid var(--line);background:transparent;color:var(--text);font:inherit;text-align:left;cursor:pointer}
.swan-quote-file-item:hover,.swan-quote-file-item:focus-visible{background:var(--panel)}
.swan-quote-file-item small,.swan-quote-file-item span{color:var(--muted)}
.swan-quote-file-item strong,.swan-quote-file-preview h3{min-width:0;overflow-wrap:anywhere}
.swan-quote-file-preview{margin-top:14px;padding-top:14px;border-top:1px solid var(--line)}
.swan-quote-file-preview iframe{display:block;width:100%;min-height:70vh;border:1px solid var(--line);background:#fff}
.swan-quote-file-preview img{display:block;max-width:100%;height:auto;background:#fff}
.swan-quote-file-preview pre{max-height:70vh;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere}
.swan-quote-file-preview select{width:auto;max-width:100%;margin-bottom:8px}
.swan-quote-file-sheet{overflow:auto;max-height:65vh}
.swan-quote-file-sheet table{width:max-content;min-width:100%}
.swan-quote-file-sheet td{white-space:pre;min-width:60px}
.swan-quote-file-sheet caption{text-align:left;color:var(--muted);padding:8px}
@media(max-width:480px){.swan-quote-file-item{grid-template-columns:48px minmax(0,1fr) auto;gap:6px;padding:10px 4px}}

.swan-quote-file-gallery{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(140px,46%),1fr));gap:10px;max-height:none;overflow:visible}
.swan-quote-file-gallery li{min-width:0}
.swan-quote-file-gallery .swan-quote-file-item{grid-template-columns:minmax(0,1fr);grid-template-rows:auto 1fr auto;align-content:start;gap:5px;height:100%;padding:8px;border:1px solid var(--line);border-radius:12px;background:var(--panel)}
.swan-quote-file-gallery .swan-quote-file-item:hover,.swan-quote-file-gallery .swan-quote-file-item:focus-visible{border-color:var(--muted)}
.swan-quote-file-gallery strong{font-size:13px;line-height:1.25}
.swan-quote-thumb{display:grid;place-items:center;aspect-ratio:5/4;position:relative;overflow:hidden;border-radius:7px;background:#2a2a2a}
.swan-quote-thumb img,.swan-quote-thumb canvas{display:block;max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain}
.swan-quote-thumb pre{margin:0;background:#fff;color:#171717;font:7px/1.4 system-ui;white-space:pre-wrap;width:86%;height:87%;padding:6px;box-sizing:border-box;overflow:hidden}
.swan-quote-thumb .swan-quote-thumb-sheet{border-spacing:0;table-layout:fixed;width:90%;font:7px/1.3 system-ui;background:#fff;color:#171717}
.swan-quote-thumb-sheet td{padding:2px;border:1px solid #ddd;white-space:nowrap;overflow:hidden;text-overflow:clip}
.swan-quote-folder-icon{display:block;position:relative;width:65%;height:49%;border-radius:6px;background:#82a3b6}
.swan-quote-folder-icon::before{content:"";position:absolute;left:0;top:-15%;height:24%;width:44%;background:inherit;border-radius:5px 5px 0 0}
.swan-quote-thumb .swan-quote-document-icon{display:grid;place-content:center;width:55%;height:74%;border-radius:4px;background:#eee;color:#252525;font-weight:750;font-size:12px}

dialog.swan-quote-file-preview{box-sizing:border-box;inset:0;width:100%;height:100%;height:100dvh;max-width:none;max-height:none;margin:0;padding:0;border:0;background:#171717;color:#f5f5f5;overflow:hidden}
dialog.swan-quote-file-preview[open]{display:flex;flex-direction:column}
dialog.swan-quote-file-preview::backdrop{background:#000}
.swan-quote-file-preview header{padding:calc(10px + env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) 10px max(12px,env(safe-area-inset-left));background:#202020;border-bottom:1px solid #424242}
.swan-quote-viewer-actions{display:flex;justify-content:space-between;gap:8px;align-items:center;margin-bottom:8px}
.swan-quote-viewer-actions .btn{min-height:40px}
.swan-quote-file-preview h3{margin:0;font-size:15px}
.swan-quote-download-status{margin:6px 0 0;font-size:13px}
.swan-quote-viewer-content{flex:1;min-height:0;overflow:auto;padding:10px max(10px,env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left))}
.swan-quote-file-preview .swan-quote-image-area{overflow:auto;margin-top:8px;max-height:75dvh}
.swan-quote-image-area img{max-width:min(100%,1300px);margin:auto}
.swan-quote-image-zoom img{max-width:none;width:max(180%,900px);margin:0}
.swan-quote-pdf-tools{display:flex;align-items:center;justify-content:center;gap:7px;padding-bottom:8px}
.swan-quote-pdf-tools .btn{min-width:40px;height:40px}
.swan-quote-pdf-tools .btn:disabled{opacity:.38}
.swan-quote-pdf-viewport{width:100%;min-height:0;overflow:auto;flex:1;overscroll-behavior:contain}
.swan-quote-viewer-content:has(.swan-quote-pdf-tools){display:flex;flex-direction:column}
.swan-quote-pdf-viewport{position:relative;overflow-anchor:none}
.swan-quote-pdf-page{box-sizing:border-box;width:var(--swan-pdf-page-width);margin:0 auto 10px;background:#fff;color:#242424;position:relative;overflow:hidden}
.swan-quote-pdf-page canvas{display:block;position:absolute;inset:0;width:100%!important;max-width:none;height:100%;object-fit:contain}
.swan-quote-pdf-page p{padding:12px}
.swan-quote-file-preview .swan-quote-file-sheet{max-height:none}
@media(max-width:480px){.swan-quote-file-gallery{grid-template-columns:repeat(2,minmax(0,1fr))}.swan-quote-file-gallery .swan-quote-file-item{grid-template-columns:minmax(0,1fr)}}

.swan-quote-file-scroll.swan-quote-upload-drop{outline:2px dashed #c7d9e3;outline-offset:-5px;background:#222b31}
.swan-quote-upload-status progress{width:100%;height:5px}
.swan-quote-upload-status p{margin:4px 0 0;font-size:13px;white-space:pre-wrap;overflow-wrap:anywhere}
.swan-quote-upload-status .swan-quote-upload-error{color:#ffbdbd}
