/* Keep the right rail for AI Analysis; CAD tables remain inside the viewport. */
body .v225-right:not(.yv241-parts-mode) .v225-part-drawer{display:none!important}

/* CAD uses the existing media stage. The native top toolbar stays in place. */
body #yv225-stage.yvbi-viewport-cad25{position:relative!important;overflow:hidden!important;isolation:isolate}
body #yv225-stage.yvbi-viewport-cad25>:not(.yvbi-cad-embedded25){visibility:hidden!important;pointer-events:none!important}
body #yv225-stage>.yvbi-instant-cad00.yvbi-cad-embedded25{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;min-width:0;min-height:0;z-index:10!important;display:grid!important;grid-template-columns:minmax(0,1fr)!important;grid-template-rows:auto minmax(0,1fr) auto!important;border-radius:inherit;overflow:hidden}
body #yv225-stage>.yvbi-cad-embedded25>nav{grid-column:1!important;grid-row:1!important;min-width:0;min-height:46px;height:auto;padding:2px 6px;gap:3px;overflow:visible;flex-wrap:wrap}
body #yv225-stage>.yvbi-cad-embedded25>nav>strong{display:none!important}
body #yv225-stage>.yvbi-cad-embedded25>nav>button{min-width:36px;height:39px;font-size:9px;padding:2px 5px;flex:0 0 auto}
body #yv225-stage>.yvbi-cad-embedded25>nav svg{width:18px;height:18px}
body #yv225-stage>.yvbi-cad-embedded25>nav>details{margin-left:auto}
body #yv225-stage>.yvbi-cad-embedded25>[data-workspace]{grid-column:1!important;grid-row:2!important;min-width:0;min-height:0;overflow:hidden}
body #yv225-stage>.yvbi-cad-embedded25>[data-status]{grid-column:1!important;grid-row:3!important;max-height:40px;overflow:hidden;padding:4px 8px;font-size:10px}
body #yv225-stage>.yvbi-cad-embedded25 [data-cad-state]{padding:6px 8px;gap:6px;flex-wrap:wrap;font-size:11px}
body #yv225-stage>.yvbi-cad-embedded25 [data-cad-state]:empty{display:none}

/* The actual native drawer owns the portaled inspector; no duplicate panel. */
body .v225-right.yv241-parts-mode #yv225-part-drawer.yvbi-cad-content25{display:flex!important;flex-direction:column;overflow:hidden!important;min-height:0!important;height:100%!important;max-height:none!important;border:0;border-radius:0;padding:0;box-shadow:none}
body #yv225-part-drawer.yvbi-cad-content25>:not(.yvbi-cad-portal25){display:none!important}
body .v225-right.yv241-parts-mode.yvbi-cad-inspecting25 .v225-right-scroll{display:flex;flex-direction:column;min-height:0;overflow:hidden!important;padding:0!important}
body .v225-right.yv241-parts-mode.yvbi-cad-inspecting25 #yv225-part-drawer.yvbi-cad-content25{flex:1 1 auto}
body #yv225-part-drawer>.yvbi-instant-cad00.yvbi-cad-portal25{position:relative!important;inset:auto!important;display:flex!important;flex:1 1 auto;flex-direction:column;min-height:0;min-width:0;width:100%!important;height:100%;z-index:auto!important;overflow:hidden;background:transparent!important;border:0;border-radius:0;box-shadow:none}
body #yv225-part-drawer>.yvbi-instant-cad00.yvbi-cad-portal25[hidden]{display:none!important}
body #yv225-part-drawer>.yvbi-cad-portal25>aside{position:relative!important;inset:auto!important;top:auto!important;right:auto!important;bottom:auto!important;left:auto!important;flex:1 1 auto!important;width:100%!important;max-width:100%!important;min-height:0!important;height:auto!important;padding:10px!important;border:0!important;border-radius:0!important;box-shadow:none!important;background:transparent!important;box-sizing:border-box;overflow:hidden}
body #yv225-part-drawer>.yvbi-cad-portal25>[data-parts-aside]{display:none!important}
body #yv225-part-drawer>.yvbi-cad-portal25[data-engineering14="true"]>[data-parts-aside],body #yv225-part-drawer>.yvbi-cad-portal25[data-parts08="false"]>[data-parts-aside],body #yv225-part-drawer>.yvbi-cad-portal25[data-selected08="true"]>[data-parts-aside]{display:none!important}
body #yv225-part-drawer>.yvbi-cad-portal25>[data-details-aside]{display:none!important}
body #yv225-part-drawer>.yvbi-cad-portal25[data-selected08="true"]>[data-details-aside],body #yv225-part-drawer>.yvbi-cad-portal25[data-engineering14="true"][data-drawer14="true"]>[data-details-aside]{display:flex!important}
body #yv225-part-drawer>.yvbi-cad-portal25[data-engineering14="true"][data-drawer14="false"]>[data-details-aside]{display:none!important}
body #yv225-part-drawer>.yvbi-cad-portal25[data-bench17="true"]>[data-details-aside],body #yv225-part-drawer>.yvbi-cad-portal25[data-bench17="true"]>[data-parts-aside],body #yv225-part-drawer>.yvbi-cad-portal25[data-guidance20="true"]>[data-details-aside],body #yv225-part-drawer>.yvbi-cad-portal25[data-guidance20="true"]>[data-parts-aside],body #yv225-part-drawer>.yvbi-cad-portal25[data-guidance20="true"]>[data-live-bench17]{display:none!important}
body #yv225-part-drawer>.yvbi-cad-portal25>[data-live-bench17][hidden],body #yv225-part-drawer>.yvbi-cad-portal25>[data-probe-guide20][hidden]{display:none!important}
body #yv225-part-drawer>.yvbi-cad-portal25 [data-inspector],body #yv225-part-drawer>.yvbi-cad-portal25 .lb17-body{min-width:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scrollbar-gutter:stable}
body #yv225-part-drawer>.yvbi-cad-portal25 [data-inspector]{flex:1 1 auto}
body #yv225-part-drawer>.yvbi-cad-portal25 [data-inspector] img{max-width:100%;height:auto}
@media(max-width:700px){body #yv225-stage>.yvbi-cad-embedded25>nav>button{min-width:31px;padding:2px 3px}body #yv225-stage>.yvbi-cad-embedded25>nav{gap:1px}}

/* Activity nodes are portaled to Analysis; the drawing consumes the full stage. */
body #yv225-stage>.yvbi-cad-embedded25>[data-workspace]{grid-template-rows:minmax(0,1fr)!important}

/* Preserve native photo/microscope part inspection when CAD is closed. The
   same native drawer returns to its original host before CAD mounts. */
body #yv225-stage.yvbi-native-table-active34{position:relative!important}
body #yv225-stage>.yvbi-native-table34{bottom:12px}
body #yv225-stage>.yvbi-native-table34 .cad27-content{overflow:auto}
body #yv225-stage>.yvbi-native-table34 #yv225-part-drawer.yvbi-native-part-drawer34{position:relative!important;inset:auto!important;display:block!important;transform:none!important;width:100%!important;height:auto!important;min-height:0!important;max-height:none!important;border:0!important;border-radius:0!important;box-shadow:none!important;overflow:visible!important;padding:10px!important;background:transparent!important;visibility:visible!important;pointer-events:auto!important}
body #yv225-stage>.yvbi-native-table34 #yv225-part-drawer> :not(#yv225-part-bar):not(#yvbi-part-focus):not(#yv340-parts-simple):not(#yvbi-part-documents){display:none!important}
body #yv225-stage.yvbi-microscope-previewing>.yvbi-native-table34,body #yv225-stage.yvbi-viewport-cad25>.yvbi-native-table34{display:none!important}

body #yv225-stage>.yvbi-native-table34 #yv225-part-drawer>#yv225-part-bar{display:flex!important;position:relative!important;inset:auto!important;width:100%!important;min-height:32px!important;padding:0 0 6px!important;border-bottom:1px solid #43515d}
body #yv225-stage>.yvbi-native-table34 #yv225-part-bar .v225-part-kicker{display:none!important}
body #yv225-stage>.yvbi-native-table34 #yv225-part-title{font-size:12px!important}
body #yv225-stage>.yvbi-native-table34 #yv225-part-drawer:not(.expanded)>#yvbi-part-focus,body #yv225-stage>.yvbi-native-table34 #yv225-part-drawer:not(.expanded)>#yv340-parts-simple,body #yv225-stage>.yvbi-native-table34 #yv225-part-drawer:not(.expanded)>#yvbi-part-documents{display:none!important}
