/* AI3D R1.5 : viewport-first, scoped layout only. Never reparent or replace WebGL DOM. */
html.ai3d-r15{min-width:0!important;max-width:100%;}
html.ai3d-r15 body{min-width:0!important;max-width:100%;overflow-x:clip;}
html.ai3d-r15 :is(main,article,section,aside,header,footer,form){min-width:0;}
html.ai3d-r15 :is(h1,h2,h3,h4,p,small,strong,label){overflow-wrap:anywhere;}
html.ai3d-r15 :is(input,select,textarea){max-width:100%;}
html.ai3d-r15 :is(img,video){max-width:100%;height:auto;}
html.ai3d-r15 :is(.an-stage,.edu-scene-stage,.edu-practice-stage,.viewer,.scene,.canvas-wrap){min-width:0;max-width:100%;}
/* Do not modify canvas transform, sizes or pointer-events: renderer manages those. */
@media(max-width:1199px){
 html.ai3d-r15 .an-shell{width:auto!important;max-width:100%!important;margin:0!important;padding:clamp(12px,2vw,24px)!important;}
 html.ai3d-r15 .an-app-grid{display:grid!important;grid-template-columns:minmax(180px,230px) minmax(0,1fr)!important;gap:14px!important;max-width:100%!important;min-width:0!important;}
 html.ai3d-r15 .an-app-grid>.an-right{grid-column:1/-1!important;}
 html.ai3d-r15 .an-app-grid>.an-center{min-width:0!important;width:auto!important;}
 html.ai3d-r15 .an-stage-heading{display:flex!important;flex-wrap:wrap!important;gap:12px!important;}
 html.ai3d-r15 .an-stage-actions{display:flex!important;flex-wrap:wrap!important;gap:8px!important;max-width:100%;}
 html.ai3d-r15 .an-hero{min-width:0;max-width:100%;}
 html.ai3d-r15 .workspace{grid-template-columns:minmax(210px,260px) minmax(0,1fr)!important;}
 html.ai3d-r15 .workspace>.editor{grid-column:1/-1!important;}
 html.ai3d-r15 .shell:has(>.center){grid-template-columns:minmax(210px,270px) minmax(0,1fr)!important;}
 html.ai3d-r15 .shell:has(>.center)>.right:last-child{grid-column:1/-1!important;}
}
@media(max-width:900px){
 html.ai3d-r15 :is(.topbar,.header,.app-header,.cf-top,.an-hero,.edu-hero,.intro,.heading){height:auto!important;min-height:0!important;max-width:100%;}
 html.ai3d-r15 :is(.topbar,.header,.app-header,.cf-top,.an-hero,.edu-hero,.intro,.heading){flex-wrap:wrap!important;gap:12px!important;}
 html.ai3d-r15 :is(.topbar nav,.header nav,.app-header nav){display:flex;flex-wrap:wrap;gap:7px;max-width:100%;}
 html.ai3d-r15 :is(.edu-learning-layout,.edu-library-grid,.edu-grid,.cf-grid,.cf-two){min-width:0;max-width:100%;}
 html.ai3d-r15 .edu-learning-layout{grid-template-columns:minmax(0,1fr)!important;}
 html.ai3d-r15 .edu-side-col{grid-column:auto!important;}
 html.ai3d-r15 .edu-panel-head{flex-wrap:wrap;gap:10px;}
 html.ai3d-r15 .edu-panel-actions{display:flex;flex-wrap:wrap;gap:8px;}
}
@media(max-width:700px){
 html.ai3d-r15 body:has(.ai3d-global-nav){padding-left:0!important;}
 html.ai3d-r15 .an-shell{width:100%!important;max-width:100%!important;min-width:0!important;margin:0!important;padding:12px!important;}
 html.ai3d-r15 .an-app-grid,html.ai3d-r15 .an-app-grid[data-ai3d-r14-layout]{display:flex!important;flex-direction:column!important;width:100%!important;max-width:100%!important;min-width:0!important;gap:14px!important;}
 html.ai3d-r15 .an-app-grid>.an-center{order:0!important;min-height:0!important;width:100%!important;max-width:100%!important;min-width:0!important;}
 html.ai3d-r15 .an-app-grid>.an-left{order:1!important;width:100%!important;max-width:100%!important;min-width:0!important;}
 html.ai3d-r15 .an-app-grid>.an-right{order:2!important;width:100%!important;max-width:100%!important;min-width:0!important;}
 html.ai3d-r15 .an-hero{width:100%!important;max-width:100%!important;min-width:0!important;padding:20px 16px!important;display:block!important;}
 html.ai3d-r15 .an-hero h1{font-size:clamp(22px,6.2vw,34px)!important;line-height:1.2!important;}
 html.ai3d-r15 .an-hero-stat{display:none!important;}
 html.ai3d-r15 .an-stage-heading{display:block!important;min-width:0!important;}
 html.ai3d-r15 .an-stage-heading h2{font-size:clamp(18px,5.4vw,26px)!important;line-height:1.35!important;white-space:normal!important;}
 html.ai3d-r15 .an-legacy-label{display:block!important;max-width:100%;white-space:normal!important;}
 html.ai3d-r15 .an-stage-actions{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important;margin-top:12px!important;}
 html.ai3d-r15 .an-stage-actions button{width:100%!important;min-width:0!important;padding:10px 6px!important;white-space:normal!important;}
 html.ai3d-r15 :is(.an-layer-panel,.an-real-panel,.an-organ-r6-panel,.an-r8-studio,.an-focus-panel,.an-stage,.an-toolbar,.an-feedback,.an-panel){width:100%!important;max-width:100%!important;min-width:0!important;box-sizing:border-box!important;}
 html.ai3d-r15 .an-layer-panel{display:flex!important;flex-wrap:wrap!important;gap:10px!important;padding:12px!important;}
 html.ai3d-r15 .an-layer-tabs{display:flex!important;flex-wrap:wrap!important;gap:5px!important;max-width:100%!important;}
 html.ai3d-r15 .an-opacity{display:flex!important;flex-wrap:wrap!important;align-items:center;gap:8px!important;max-width:100%;}
 html.ai3d-r15 .an-opacity input{width:min(140px,50vw)!important;}
 html.ai3d-r15 :is(.an-real-main,.an-r6-top,.an-r8-heading,.an-r8-actions,.an-focus-panel,.an-toolbar){display:flex!important;flex-wrap:wrap!important;gap:8px!important;}
 html.ai3d-r15 :is(.an-real-controls,.an-r6-grid,.an-r6-sliders,.an-r8-plan){max-width:100%;min-width:0;}
 html.ai3d-r15 .an-stage{min-height:360px!important;height:clamp(360px,90vw,530px)!important;position:relative;}
 html.ai3d-r15 .an-stage-help{max-width:100%!important;font-size:11px!important;white-space:normal!important;}
 html.ai3d-r15 .an-organs{max-height:350px;overflow-y:auto;}
 html.ai3d-r15 .an-panel{position:static!important;}
 html.ai3d-r15 .an-panel-title{max-width:100%;}
 html.ai3d-r15 :is(.an-right select,.an-right button,.an-toolbar button){min-height:44px;}
 html.ai3d-r15 :is(.workspace,.shell:has(>.center),.layout){display:flex!important;flex-direction:column!important;width:100%!important;max-width:100%!important;min-width:0!important;}
 html.ai3d-r15 :is(.workspace,.shell:has(>.center),.layout)>*{width:100%!important;min-width:0!important;max-width:100%!important;}
 html.ai3d-r15 :is(.workspace .panel,.layout .sidebar,.layout .left){position:static!important;min-height:0!important;max-height:none!important;}
 html.ai3d-r15 :is(.shell,.edu-shell,.cf-shell,.ai3d-portal-main){max-width:100%!important;min-width:0!important;}
 html.ai3d-r15 :is(.shell .header,.intro,.heading,.topbar,.cf-top,.app-header){padding:16px!important;}
 html.ai3d-r15 :is(.shell .center,.workspace .panel,.layout .center,.layout .sidebar,.layout .left){padding:14px!important;}
 html.ai3d-r15 :is(.topbar,.header,.app-header){display:flex!important;flex-direction:column!important;align-items:flex-start!important;}
 html.ai3d-r15 :is(.topbar nav,.header nav,.app-header nav){width:100%!important;overflow-x:auto;flex-wrap:nowrap!important;padding-bottom:4px;}
 html.ai3d-r15 :is(.topbar nav a,.header nav a,.app-header nav a){white-space:nowrap;}
 html.ai3d-r15 :is(.edu-learning-layout,.edu-lesson-heading,.edu-hero,.edu-practice-controls,.edu-scene-controls,.edu-practice-header){display:flex!important;flex-direction:column!important;align-items:stretch!important;gap:10px!important;max-width:100%!important;}
 html.ai3d-r15 .edu-learning-layout>*{min-width:0!important;width:100%!important;max-width:100%!important;}
 html.ai3d-r15 .edu-shell{padding:12px!important;}
 html.ai3d-r15 :is(.edu-panel,.edu-hero,.edu-scene-panel){max-width:100%!important;min-width:0!important;padding:14px!important;}
 html.ai3d-r15 .edu-scene-stage{min-height:300px!important;height:clamp(300px,85vw,470px)!important;}
 html.ai3d-r15 .edu-practice-stage{min-height:260px!important;}
 html.ai3d-r15 :is(.edu-scene-overlay,.edu-practice-controls){max-width:100%!important;}
 html.ai3d-r15 :is(.cf-shell,.ai3d-portal-main){padding:16px!important;}
 html.ai3d-r15 :is(.cf-two,.cf-grid,.cf-layout,.edu-concept-grid,.edu-r2-study-grid){grid-template-columns:minmax(0,1fr)!important;}
 html.ai3d-r15 :is(.viewer,.viewer-wrap,.stage){max-width:100%!important;}
 html.ai3d-r15 :is(button,select,input[type="text"],input[type="search"],input[type="password"]){max-width:100%;}
}
@media(max-width:390px){
 html.ai3d-r15 .an-stage-actions{grid-template-columns:minmax(0,1fr)!important;}
 html.ai3d-r15 .an-shell{padding:8px!important;}
 html.ai3d-r15 .an-stage{min-height:320px!important;height:380px!important;}
 html.ai3d-r15 :is(h1,h2){overflow-wrap:anywhere;}
}
@media(hover:none) and (pointer:coarse){html.ai3d-r15 :is(button,select,[role="button"]){min-height:44px;}}
@media(prefers-reduced-motion:reduce){html.ai3d-r15 *,html.ai3d-r15 *::before,html.ai3d-r15 *::after{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important;}}
