/* BIM Viewer – same layout rhythm and controls as 7D CONTROL / Pläne. */
body[data-route="bim"] .main{padding:8px 10px 10px}
@media(min-width:761px){body[data-route="bim"] .shell{grid-template-columns:214px minmax(0,1fr)}}
@media(min-width:761px) and (max-width:1280px){body[data-route="bim"] .shell{grid-template-columns:196px minmax(0,1fr)}}
@media(min-width:761px){body[data-route="bim"].side-collapsed .shell{grid-template-columns:var(--nav-collapsed,68px) minmax(0,1fr)}}
.bim7d{--bim-ink:var(--ink,#2b241f);--bim-sub:var(--muted,#7d6d62);--bim-border:var(--line,#e5d9cc);--bim-brand:var(--brand,#8a4a24);color:var(--bim-ink);font-size:13px;min-width:0;padding:0 0 10px}
.bim7d *{box-sizing:border-box}
.bim7d-top{margin:0 0 9px;display:flex;align-items:center;min-height:29px}
.bim7d h1{font-size:21px;line-height:1.2;font-weight:750;margin:0}
.bim7d h2{font-size:18px;margin:0}
.bim7d h3{font-size:15px;margin:14px 0 5px}
.bim7d .hint{color:var(--bim-sub);font-size:12px;line-height:1.45}
.bim7d button{font:inherit;font-size:12.5px;font-weight:700;border:1px solid transparent;background:#efe5da;color:var(--bim-ink);border-radius:10px;min-height:34px;padding:6px 11px;white-space:nowrap;cursor:pointer}
.bim7d button:hover{filter:brightness(.98)}
.bim7d button.primary{background:var(--bim-brand);color:#fff}
.bim7d button.ghost{background:transparent;border-color:var(--bim-border)}
.bim7d button:disabled{opacity:.55;cursor:wait}
.bim7d label{display:flex;flex-direction:column;gap:4px;font-size:11.5px;font-weight:700;color:var(--bim-sub);min-width:0}
.bim7d select,.bim7d input:not([type=checkbox]):not([type=range]){font:inherit;font-size:12.5px;min-height:34px;padding:5px 9px;border:1px solid var(--bim-border);border-radius:10px;background:#fff;max-width:100%;color:var(--bim-ink)}
.bim7d input[type=file]{width:min(245px,100%)}
.bim7d-error{margin:0 0 10px;background:#fff2ef;color:#a13d32;padding:11px 13px;border:1px solid #e6b3ac;border-radius:11px;font-size:13px}
.bim7d-error[hidden]{display:none}
.bim7d-card{padding:12px;border:1px solid var(--bim-border);border-radius:14px;background:#fff;box-shadow:var(--shadow,0 8px 20px #39231010);margin-bottom:10px}
.bim7d-import{display:grid;gap:10px}
.bim7d-import-head{display:grid;gap:3px}.bim7d-import-head .hint{margin:0}
.bim7d-import form{display:flex;align-items:end;gap:8px;flex-wrap:wrap}
.bim7d-import-compact{background:#fbf7f1}
.bim7d-toolbar{display:flex;align-items:flex-end;flex-wrap:wrap;gap:8px;padding:9px 10px;margin-bottom:8px;background:#fff;border:1px solid var(--bim-border);border-radius:14px;box-shadow:0 2px 10px rgba(57,35,16,.035)}
.bim7d-toolbar label select{min-width:115px;max-width:155px;width:100%}
.bim7d-toolbar label.bim7d-search{flex:0 1 205px}
.bim7d-toolbar input[type=search]{width:100%}
.bim7d-modes{display:flex;align-items:flex-end;gap:5px;padding-right:5px;align-self:end}
.bim7d-modes button{min-height:34px;height:34px;padding:6px 12px;background:#fbf7f1;border:1px solid var(--bim-border);border-radius:10px}
.bim7d-modes button.active{background:var(--bim-brand);border-color:var(--bim-brand);color:#fff}
.bim7d-toolbar .bim7d-zoom{flex:0 0 100px}
.bim7d-zoom input{accent-color:var(--bim-brand);width:98px;height:29px;margin:0;min-height:0}
.bim7d-toolbar-actions{margin-left:auto;align-self:end}
.bim7d-toolbar-actions button{min-height:34px;height:34px}
.bim7d-canvas{display:flex;flex-direction:column;min-width:0;padding:7px;background:#fff;border:1px solid var(--bim-border);border-radius:16px;box-shadow:var(--shadow,0 10px 28px rgba(57,35,16,.1))}
.bim7d-canvas-wide{min-height:calc(100dvh - 112px)}
.bim7d-stage{position:relative;flex:1 1 auto;min-width:0;width:100%;min-height:calc(100dvh - 197px);height:calc(100dvh - 197px);max-height:none;overflow:hidden;display:flex;align-items:center;justify-content:center;background:#f5f3ef;border:1px solid #d8d0c8;border-radius:11px}
.bim7d-stage.real3d-stage{display:block;background:#0e1826}
.bim7d-stage .viewer-svg{width:100%;height:100%;display:block}
.bim7d-stage .viewer-target{cursor:pointer}
.bim7d-stage .viewer-target:hover{opacity:.74}
.bim7d-stage .real3d-canvas{display:block;width:100%;height:100%;cursor:grab;touch-action:none}
.bim7d-stage .real3d-canvas:active{cursor:grabbing}
.bim7d-stage .real3d-info{position:absolute;bottom:10px;left:10px;z-index:1;pointer-events:none;background:#162d41d9;color:#edf7fc;border-radius:8px;padding:7px 10px;font-size:12px;max-width:calc(100% - 20px)}
.bim7d-stage .real3d-error{color:#ffb6a9}
.bim7d-legend-wrap{padding:10px 8px 5px}
.bim7d-legend{display:flex;flex-wrap:wrap;gap:10px 18px;align-items:center;min-height:18px}
.bim7d-legend-item{display:inline-flex;align-items:center;gap:7px;color:var(--bim-sub);font-size:12px;white-space:nowrap}
.bim7d-legend-item i{display:inline-block;width:12px;height:12px;border-radius:4px;box-shadow:inset 0 0 0 1px #0000000d;flex:0 0 12px}
.bim7d-empty{padding:16px;text-align:center;color:var(--bim-sub)}
/* The details dialog follows the existing 7D .modal-card design. */
.bim7d-modal[hidden]{display:none!important}
.bim7d-modal{position:fixed;inset:0;z-index:1000;display:grid;place-items:center;padding:18px}
.bim7d-modal-backdrop{position:absolute;inset:0;background:rgba(0,0,0,.34)}
.bim7d-modal-card{position:relative;z-index:1;width:min(760px,94vw);max-height:88dvh;padding:20px;border:1px solid var(--bim-border);border-radius:20px;background:#fff;box-shadow:0 24px 80px rgba(30,20,12,.24);overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable}
.bim7d-pro{min-width:0}
.bim7d-prohead{position:sticky;top:-20px;z-index:3;display:flex;justify-content:space-between;align-items:center;gap:12px;background:#fff;border-bottom:1px solid var(--bim-border);padding:6px 0 12px;margin:0 0 14px}
.bim7d-prohead h2{font-size:18px;margin:0}
.bim7d-prohead button{background:#f2e8dd;min-width:34px;min-height:34px;height:34px;padding:0;font-size:20px;line-height:1}
.bim7d-pro .hint{margin:7px 0}
.bim7d-kv{display:grid;grid-template-columns:minmax(90px,35%) minmax(0,1fr);gap:12px;padding:8px 0;border-bottom:1px solid #efe6dc;line-height:1.4;font-size:12px}
.bim7d-kv span{color:var(--bim-sub);overflow-wrap:anywhere}
.bim7d-kv strong{font-weight:600;overflow-wrap:anywhere;color:var(--bim-ink)}
.bim7d-summary{border:1px solid #efe6dc;border-radius:12px;padding:3px 12px;margin:12px 0}
.bim7d-assetlink{border:1px solid var(--bim-border);background:#fbf7f1;padding:12px;border-radius:12px;margin:14px 0;display:grid;gap:8px}
.bim7d-assetlink p{margin:0}
.bim7d-assetlink select{width:100%}
.bim7d-paramgroup{border-top:1px solid #efe6dc;padding:12px 0}
.bim7d-paramgroup summary{font-weight:750;cursor:pointer;padding:4px 0 10px}
.bim7d-param-search{display:grid;gap:5px;color:var(--bim-sub);font-size:12px}
.bim7d-param-search input{width:100%}
.bim7d-check{display:flex;align-items:center;gap:7px;font-size:12px;color:#5f534b;margin:10px 0}
.bim7d-paramlist{max-height:320px;overflow:auto}
.bim7d-paramrow[hidden]{display:none!important}
@media(max-width:990px){
 .bim7d-toolbar{gap:7px}
 .bim7d-toolbar .bim7d-search{flex:1 1 190px}
 .bim7d-toolbar-actions{margin-left:auto}
 .bim7d-stage{height:65dvh;min-height:350px}
 .bim7d-canvas-wide{min-height:0}
}
@media(max-width:760px){
 body[data-route="bim"] .main{padding:10px}
 .bim7d h1{font-size:21px}
 .bim7d-toolbar{padding:8px;gap:6px}
 .bim7d-modes{width:100%;gap:6px}
 .bim7d-modes button{flex:1}
 .bim7d-toolbar label:not(.bim7d-search){flex:1 1 110px}
 .bim7d-toolbar .bim7d-search{flex:1 1 100%}
 .bim7d-toolbar-actions{margin-left:auto}
 .bim7d-zoom input{max-width:100%}
 .bim7d-stage{height:58dvh;min-height:320px}
 .bim7d-modal{padding:10px}
 .bim7d-modal-card{width:min(100%,680px);max-height:90dvh;padding:14px;border-radius:16px}
 .bim7d-prohead{top:-14px}
 .bim7d-import form{display:grid;width:100%}
 .bim7d-import form label{width:100%}
 .bim7d-kv{grid-template-columns:1fr;gap:2px}
}
