/* Native dialog's top layer is outside the app's sidebar/transform stacking contexts. */
.file-preview-dialog { box-sizing:border-box; width:min(1400px,96vw); max-width:96vw;
    height:90vh; height:90dvh; max-height:94dvh; margin:auto; padding:0; border:1px solid #334155;
    border-radius:16px; color:#e2e8f0; background:#09090d; overflow:hidden; }
.file-preview-dialog::backdrop { background:rgb(0 0 0 / .7); backdrop-filter:blur(4px); }
.file-preview-shell { display:flex; flex-direction:column; height:100%; min-height:0; }
.file-preview-header { display:flex; align-items:center; justify-content:space-between; gap:12px;
    padding:12px 18px; flex:none; border-bottom:1px solid #334155; }
.file-preview-title { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.file-preview-actions { display:flex; align-items:center; gap:8px; flex:none; }
.file-preview-content { flex:1; min-width:0; min-height:0; overflow:auto; padding:12px; }
.file-preview-content > div { min-height:0; }
.file-preview-button { padding:7px 10px; border:1px solid #475569; border-radius:7px; background:#1e293b;
    color:#e2e8f0; cursor:pointer; font-size:13px; white-space:nowrap; text-decoration:none; }
.file-preview-button:hover { background:#334155; }
.file-preview-button:disabled { opacity:.4; cursor:default; }
.file-preview-button[aria-pressed=true] { background:#9f1239; }
.text-file-preview { position:relative; height:100%; background:#0f172a; border-radius:8px; overflow:auto; }
.text-file-preview pre { margin:0; padding:16px; white-space:pre-wrap; overflow-wrap:anywhere; font:13px/1.6 monospace; color:#e2e8f0; }
.dxf-preview { display:flex; flex-direction:column; height:100%; min-height:0; position:relative; background:#000; color:#e2e8f0; }
.dxf-toolbar { display:flex; gap:6px; flex-wrap:wrap; padding:8px; flex:none; background:#0f172a; }
.dxf-stage { position:relative; flex:1; min-height:120px; overflow:hidden; }
.dxf-canvas { position:absolute; inset:0; touch-action:none; }
.dxf-canvas canvas { display:block; }
.dxf-layers { position:absolute; left:8px; top:8px; bottom:8px; width:min(240px,70%); overflow:auto;
    z-index:2; padding:10px; border:1px solid #475569; border-radius:8px; background:rgb(15 23 42 / .96); }
.dxf-layers label { display:flex; align-items:center; gap:8px; padding:5px; font-size:13px; overflow-wrap:anywhere; cursor:pointer; }
.dxf-layer-color { width:12px; height:12px; flex:none; border:1px solid #64748b; }
.dxf-status { flex:none; display:flex; gap:12px; flex-wrap:wrap; padding:6px 10px; font-size:12px; background:#0f172a; }
.dxf-overlay { position:absolute; inset:0; z-index:3; display:flex; flex-direction:column;
    justify-content:center; align-items:center; text-align:center; padding:24px; gap:12px; background:#0f172a; }
.dxf-warning { padding:5px 10px; color:#fbbf24; font-size:12px; background:#1e293b; }
[x-cloak] { display:none !important; }
@media(max-width:640px) {
    .file-preview-dialog { width:98vw; max-width:98vw; height:94dvh; border-radius:10px; }
    .file-preview-header { padding:8px; } .file-preview-content { padding:4px; }
    .dxf-toolbar { gap:4px; padding:4px; } .file-preview-button { font-size:12px; padding:6px 8px; }
}
