/* Scoped additions, preserving the existing scene, site tools, AI and project dialogs. */
#modularBuilder { --mh-editor-blue:#1766ed; isolation:isolate; }
#modularBuilder .mh-workspace { min-width:0; }
#modularBuilder.mh-plan-active .mh-canvas-toolbar { display:none; }
#modularBuilder .mh-editor-quickbar { display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:12px 16px;background:#edf4ff;border-bottom:1px solid #d5e3f8;color:#29476f;font-size:12px; }
#modularBuilder .mh-editor-quickbar>span { font-weight:800;margin-right:auto; }
#modularBuilder .mh-editor-quickbar button { min-height:38px;border:1px solid #b8cff0;border-radius:9px;background:#fff;color:#1856af;padding:7px 12px;font:700 12px inherit;cursor:pointer; }
#modularBuilder .mh-editor-quickbar label { display:flex;gap:7px;align-items:center;white-space:nowrap; }
#modularBuilder .mh-editor-quickbar input { width:17px;height:17px;accent-color:#1766ed; }
#modularBuilder .mh-editor-sheetbar { display:none; }
#modularBuilder .mh-properties { scroll-padding-top:70px; }
#modularBuilder .mh-properties-head { padding:15px;font-size:13px; }
#modularBuilder .mh-property-form input:not([type=range]):not([type=color]):not([type=checkbox]),#modularBuilder .mh-property-form select { min-height:36px;font-size:13px; }
#modularBuilder .mh-property-form label>span { font-size:11px; }
#modularBuilder .mh-professional-bar,#modularBuilder .mh-project-metrics { position:static; }
#modularBuilder .mh-canvas-toolbar { height:auto;min-height:92px; }
#modularBuilder .mh-canvas-toolbar>div { display:flex;flex-wrap:wrap;gap:6px; }
#modularBuilder .mh-canvas-toolbar button,#modularBuilder .mh-canvas-toolbar select { min-height:32px;font-size:11px; }
#modularBuilder .mh-canvas-toolbar label { font-size:10px; }
#modularBuilder .mh-property-form { margin-top:12px; }
#modularBuilder .mpe-3d-hint { margin:0;padding:10px 16px;background:#f3f7fc;font-size:12px;line-height:1.5; }
#modularBuilder .mh-plan-active [hidden],#modularBuilder [hidden] { display:none!important; }
body.mh-editor-sheet-open { overflow:hidden; }
@media(min-width:1101px) {
  #modularBuilder { grid-template-columns:210px minmax(0,1fr) 305px; }
  #modularBuilder .mh-library,#modularBuilder .mh-properties { max-height:1000px;overflow:auto; }
  #modularBuilder [data-editor-panel] { display:none; }
  #modularBuilder:fullscreen .mh-library,#modularBuilder:fullscreen .mh-properties { max-height:100%; }
}
@media(max-width:1100px) {
  #modularBuilder { grid-template-columns:minmax(0,1fr); }
  #modularBuilder .mh-builder-top { grid-column:1;grid-row:1; }
  #modularBuilder .mh-workspace { grid-column:1;grid-row:2; }
  #modularBuilder .mh-render-panel { grid-column:1;grid-row:3; }
  #modularBuilder .mh-library,#modularBuilder .mh-properties { display:none; }
  #modularBuilder[data-editor-panel="library"] .mh-library,
  #modularBuilder[data-editor-panel="properties"] .mh-properties { display:block;position:fixed!important;left:8px;right:8px;bottom:8px;top:auto;width:auto!important;max-width:760px;margin:auto;max-height:55dvh!important;overflow:auto;overscroll-behavior:contain;z-index:100050;border:1px solid #b9cff0;border-radius:16px;box-shadow:0 -12px 60px #11284d55;background:#fff;padding-bottom:20px; }
  #modularBuilder .mh-editor-sheetbar { display:flex;align-items:center;gap:10px;position:sticky;top:0;z-index:4;padding:12px;background:#1766ed;color:#fff; }
  #modularBuilder .mh-editor-sheetbar b { margin-right:auto;font-size:13px; }
  #modularBuilder .mh-editor-sheetbar button { border:1px solid #ffffff70;border-radius:7px;padding:7px;background:#fff;color:#144dad;min-height:36px;font-size:12px;cursor:pointer; }
  #modularBuilder .mh-canvas-wrap { height:430px;min-height:340px; }
  #modularBuilder .mh-editor-quickbar>span { display:none; }
  #modularBuilder .mh-canvas-help { display:none; }
}
@media(max-width:600px) {
  #modularBuilder .mh-editor-quickbar { padding:10px;gap:7px; }
  #modularBuilder .mh-editor-quickbar button { flex:1;padding:7px;font-size:11px; }
  #modularBuilder .mh-editor-quickbar label { width:100%;font-size:11px; }
  #modularBuilder .mh-canvas-wrap { height:365px; }
  #modularBuilder .mh-camera-views { max-width:100%; }
  #modularBuilder .mh-camera-view-control select { min-width:80px;max-width:115px; }
  #modularBuilder .mh-canvas-toolbar>div { overflow:visible; }
  #modularBuilder .mh-professional-bar { flex-wrap:wrap;height:auto;padding:10px; }
  #modularBuilder .mh-project-metrics { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));height:auto; }
  #modularBuilder .mh-project-metrics>div { min-width:0; }
}
/* Keep the site contact action accessible without covering the editing surface. */
body:has(#modularBuilder) #smetroomTelegramWidget { position:relative!important;inset:auto!important;z-index:1!important;margin:24px auto!important;max-width:92vw; }

#modularBuilder .mh-editor-quickbar .editor-collab-launch { position:static!important;inset:auto!important;z-index:auto!important;margin:0;box-shadow:none;flex:0 0 auto; }


/* The production navigation injects a third header item; reserve its real width. */
@media(max-width:600px) {
  body:has(#modularBuilder) .mh-topbar { gap:8px;padding:0 10px;width:100%;min-width:0;height:65px; }
  body:has(#modularBuilder) .mh-topbar .mh-brand { flex:1 1 auto;min-width:0; }
  body:has(#modularBuilder) .mh-topbar .mh-brand img { width:min(112px,30vw);max-width:100%; }
  body:has(#modularBuilder) .mh-topbar .mh-top-cta { flex:0 0 auto;padding:0 9px;font-size:10px;white-space:nowrap;min-height:40px; }
  body:has(#modularBuilder) .mh-topbar #smetroomGlobalMenuButton { flex:0 0 auto;min-width:0;padding:0 9px;gap:6px; }
}
@media(max-width:380px) {
  body:has(#modularBuilder) .mh-topbar #smetroomGlobalMenuButton { width:42px;justify-content:center; }
  body:has(#modularBuilder) .mh-topbar #smetroomGlobalMenuButton span { position:absolute;clip:rect(0,0,0,0);width:1px;height:1px;overflow:hidden;white-space:nowrap; }
}

