.workspace-switch { flex: 0 0 auto; box-sizing: border-box; pointer-events: auto; }
.quantity-kind-progress, .quantity-kind-progress > span { display: none; }
body:has(#viewer[data-pending-quantity-kind] #loading[hidden]) > .quantity-kind-progress {
  display: grid; place-items: center; position: fixed; inset: 0; z-index: 2147482500;
  background: #dce1e7; color: #304957; font: 550 16px/1.4 system-ui,sans-serif;
}
body:has(#viewer[data-pending-quantity-kind="concrete"]) > .quantity-kind-progress > [data-kind="concrete"],
body:has(#viewer[data-pending-quantity-kind="formwork"]) > .quantity-kind-progress > [data-kind="formwork"] { display: block; }
.workspace-switch .workspace-switch-trigger {
  position: relative; display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
  box-sizing: border-box; min-width: 65px; min-height: 44px; margin: 0; padding: 3px 18px 3px 8px;
  border: 1px solid #bed2cd; border-radius: 7px; background: #f1f7f5; color: #195a51;
  font: 550 13px/1.12 system-ui,sans-serif; text-align: left; white-space: nowrap; cursor: pointer;
}
.workspace-switch-trigger strong { font-size: 15px; font-weight: 680; }
.workspace-switch-trigger::after {
  content: ""; position: absolute; right: 7px; top: calc(50% - 4px); width: 5px; height: 5px;
  border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg);
}
.workspace-switch-trigger[aria-expanded=true]::after { transform: rotate(225deg); top: 50%; }
.workspace-switch-menu {
  position: fixed; z-index: 24; box-sizing: border-box; width: min(182px,calc(100vw - 12px)); overflow: auto;
  padding: 5px; border: 1px solid #c5d6d1; border-radius: 10px; background: #fff; color: #1a4146;
  box-shadow: 0 6px 22px #183a4229; font: 550 14px/1.25 system-ui,sans-serif; pointer-events: auto;
}
.workspace-switch-menu[hidden], .workspace-switch-menu [hidden] { display: none !important; }
.workspace-switch-menu button {
  display: flex; align-items: center; justify-content: space-between; gap: 5px; width: 100%; min-height: 40px;
  padding: 6px 9px; box-sizing: border-box; border: 0; border-radius: 6px; background: #fff; color: inherit;
  text-align: left; font: inherit; cursor: pointer;
}
.workspace-switch-menu button:hover:enabled, .workspace-switch-menu button:focus-visible { background: #eef5f2; }
.workspace-switch-menu button:disabled { color: #748580; cursor: default; opacity: .7; }
.workspace-switch-menu button[aria-current=page] { background: #e3f2ed; color: #126358; opacity: 1; }
.workspace-switch-menu button small { font-size: 11px; font-weight: 500; }
.workspace-switch-list > button[aria-expanded]::after {
  content: ""; width: 6px; height: 6px; margin-right: 3px;
  border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(-45deg);
}
.workspace-switch-list > button[aria-expanded=true]::after { transform: rotate(45deg); }
.workspace-switch-kinds {
  display: grid; grid-template-columns: 1fr 1fr; gap: 3px; margin: 3px 0 4px 9px;
  padding: 3px; border-radius: 7px; background: #f0f5f3;
}
.workspace-switch-kinds button {
  flex-direction: column; justify-content: center; gap: 2px; min-height: 40px; padding: 3px; font-size: 13px;
  background: transparent;
}
.workspace-switch-kinds button[aria-pressed=true] { background: #fff; color: #126358; font-weight: 700; box-shadow: 0 0 0 1px #b9d5ca inset; }
.workspace-switch-kinds .model-kind-update { grid-column: 1 / -1; min-height: 32px; color: #126358; }
.workspace-switch-menu > button { margin-top: 2px; border-top: 1px solid #e1e8e5; border-radius: 0; font-size: 13px; }
#viewer[data-has-workspace-switch] > .workspace-switch {
  position: absolute; z-index: 3; top: 0; left: 0; display: flex; align-items: center; height: calc(var(--tool-height,54px) + var(--tool-safe-top,0px));
  padding: var(--tool-safe-top,0px) 4px 0 max(4px,env(safe-area-inset-left,0px)); background: #fff;
  border-bottom: 1px solid #ccd9d6;
}
#viewer[data-has-workspace-switch] > #quantityTopTools { left: var(--workspace-switch-width,calc(73px + env(safe-area-inset-left,0px))); }
#viewer[data-has-workspace-switch] > #quantityTopTools > .workspace-mode-switch,
body[data-has-workspace-switch] > header :is(.brand,.workspaceModes,#cadEdit),
body[data-has-workspace-switch] #cadDialog :is(#cadBack,#cadApply,#cadAppend),
body[data-has-workspace-switch] #quantityPanel #returnModel { display: none !important; }
body[data-has-workspace-switch] #cadWorkspaceTitle { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
body[data-has-workspace-switch] #cadDialog .cadWorkspaceName:has(#cadTitle:empty) { display: none; }
body[data-has-workspace-switch] #quantityPanel:not(.quantityToolbarReady) .quantityBar { top: 0; left: 0; padding: 3px 5px; align-items: center; }
body[data-has-workspace-switch] #quantityPanel.quantityToolbarReady .workspace-switch { display: none; }
@media(max-width:420px) {
  body[data-has-workspace-switch] > header:has(> .workspace-switch) {
    padding-left:max(4px,env(safe-area-inset-left,0px)); column-gap:4px;
  }
  .workspace-switch .workspace-switch-trigger { min-width: 60px; }
  .workspace-switch-menu button, #cadDialog .workspace-switch-menu button { min-height: 44px; }
}
