/* 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; }
}

/* The drawing and conversation share available space, including the modal top layer. */
.dxf-body{display:flex;flex:1;min-height:0;min-width:0}.dxf-body>.dxf-stage{min-width:0}
.dxf-chat{display:flex;flex-direction:column;flex:0 0 min(440px,45%);min-width:0;min-height:0;border-left:1px solid #334155;background:#0f172a;overflow:hidden}
.dxf-chat-hint{margin:0;padding:8px 12px;font-size:12px;line-height:1.5;border-bottom:1px solid #334155}
.dxf-chat-mount{flex:1;min-height:0;display:flex}.dxf-chat-mount>.sw-panel-root{flex:1;min-height:0;display:flex}
.dxf-chat .sw-panel-root>.sw-workspace{position:relative;inset:auto;width:100%;height:100%!important;min-height:0;box-shadow:none;border:0;z-index:auto}
.dxf-chat .sw-composer{padding:10px}.dxf-chat .sw-messages{padding:12px}
@media(max-width:700px){.dxf-with-chat{flex-direction:column;overflow:auto}.dxf-with-chat>.dxf-stage{flex:1;min-height:120px}.dxf-chat{flex:2;min-height:360px;border-left:0;border-top:1px solid #334155}}

.dxf-selection{position:absolute;pointer-events:none;border:2px solid #fbbf24;box-shadow:0 0 0 1px #000;z-index:2;box-sizing:border-box}.dxf-draft-status{display:flex;gap:8px;flex-wrap:wrap;padding:0 8px;font-size:12px;line-height:1.5;background:#0f172a;overflow-wrap:anywhere;max-height:100px;overflow:auto}.dxf-draft-status span:empty{display:none}
