/* CARL V3.4 · MAYA MOBILE & AUTH · scoped layout corrections.
   The V7 sphere and 3D face are intentionally untouched. */
#particleView,#c32Panel,#c33Lab,#c33Gift{box-sizing:border-box}
#particleView{width:100%;max-width:100vw;overflow-x:hidden;overflow-y:auto;overscroll-behavior-y:contain}
#particleView .particle-top{min-width:0;flex-wrap:wrap}
#particleView .particle-top>div:first-child{min-width:0;flex:1}
#particleView .maya-top-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;min-width:0}
#particleView #c33MayaHub{flex:none;width:100%;min-width:0;max-width:100%;box-sizing:border-box}
#particleView #mayaWorkbench{min-width:0;max-width:100%;box-sizing:border-box;flex-shrink:0}
#particleView #mayaWorkbench *{box-sizing:border-box}
#particleView #mayaWorkbench .maya-work-row{flex-wrap:wrap;gap:10px}
#particleView #mayaWorkbench .maya-object-info{flex:1;min-width:0;overflow-wrap:anywhere}
#particleView #mayaWorkbench .maya-work-row label{flex:0 1 200px;min-width:0;max-width:100%}
#particleView #mayaWorkbench .maya-prompt-form{min-width:0;max-width:100%;flex-wrap:wrap}
#particleView #mayaWorkbench .maya-prompt-form input{flex:1 1 180px;min-width:0;max-width:100%}
#particleView #mayaWorkbench .maya-action-row{min-width:0;flex-wrap:wrap}
#particleView #mayaWorkbench .maya-action-row button{flex:1 1 115px;min-width:0;max-width:100%;white-space:normal;overflow-wrap:anywhere}
#particleView #mayaWorkbench .maya2-filter{flex:1 1 100%;min-width:0;flex-wrap:wrap;gap:6px;overflow-wrap:anywhere}
#particleView #mayaWorkbench .maya2-filter select{width:min(100%,260px);max-width:100%;min-width:0}
#particleView #maya2Note{min-width:0;overflow-wrap:anywhere}
#particleView .particle-stats{flex-wrap:wrap;min-width:0}
#particleView .particle-stats>*{min-width:0;overflow-wrap:anywhere}
/* Single panel, never an oversized desktop floating window on phones. */
#c32Panel,#c33Lab,#c33Gift{max-width:100vw}
#c32Panel .c32-body,#c33Lab .c33-content{min-width:0;overflow-wrap:anywhere}
#c32Panel input,#c32Panel textarea,#c32Panel select,
#c33Lab input,#c33Lab textarea,#c33Lab select{max-width:100%;min-width:0}
#c32Panel .c32-table{table-layout:auto}
#c32Panel .c32-table td,#c32Panel .c32-table th{overflow-wrap:anywhere}
#c33Lab .c33-grid>*{min-width:0;max-width:100%}
#c33Lab .c33-row>*{max-width:100%;min-width:0}
#c33Lab .c33-card{min-width:0}
#c33Lab .c33-preview{max-width:100%}
#c33Gift .c33-gift-layout{width:100%;max-width:100%;box-sizing:border-box}
@media(max-width:740px){
  #particleView{padding:max(14px,env(safe-area-inset-top)) 12px calc(22px + env(safe-area-inset-bottom));gap:10px;min-height:100dvh;display:flex}
  #particleView .particle-top{align-items:center;gap:8px}
  #particleView .particle-top h2{font-size:clamp(20px,6vw,28px);line-height:1.15;overflow-wrap:anywhere}
  #particleView .maya-top-actions{flex:0 0 auto;display:grid;grid-template-columns:1fr;gap:5px}
  #particleView .maya-top-actions button{font-size:10px;min-height:38px;width:100%;white-space:normal;max-width:148px}
  #particleView #c33MayaHub{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;padding:10px;border-radius:12px}
  #particleView #c33MayaHub small{grid-column:1/-1;width:auto;font-size:10px;margin:0 0 3px}
  #particleView #c33MayaHub button{width:100%;min-width:0;min-height:45px;font-size:11px;padding:10px 6px;letter-spacing:.02em;white-space:normal;overflow-wrap:anywhere}
  #particleView #mayaWorkbench{margin:0;gap:9px;border-radius:12px;padding:11px}
  #particleView #mayaWorkbench .maya-work-row{display:grid;grid-template-columns:minmax(0,1fr);gap:8px}
  #particleView #mayaWorkbench .maya-work-row label{width:100%;min-width:0;max-width:100%}
  #particleView #mayaWorkbench .maya-work-row select{width:100%}
  #particleView #mayaWorkbench .maya-object-info{width:100%;min-width:0}
  #particleView #mayaWorkbench .maya-prompt-form{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:7px;width:100%}
  #particleView #mayaWorkbench .maya-prompt-form input{width:100%;min-width:0;padding:10px 8px}
  #particleView #mayaWorkbench .maya-prompt-form button{min-width:76px;padding:9px 8px}
  #particleView #maya2Modes{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}
  #particleView #mayaWorkbench #maya2Modes button{min-height:42px;width:100%;min-width:0;padding:8px 4px;font-size:9px;flex:none}
  #particleView #mayaWorkbench .maya-action-row:not(#maya2Modes){display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
  #particleView #mayaWorkbench .maya-action-row:not(#maya2Modes)>button{min-height:43px;width:100%;min-width:0;flex:none;font-size:9px;padding:8px 5px}
  #particleView #mayaWorkbench .maya2-filter{grid-column:1/-1;display:flex;min-width:0;align-items:center}
  #particleView #mayaWorkbench .maya2-filter select{flex:1;min-width:0;width:auto;max-width:100%}
  #particleView .particle-space{flex:0 0 auto;min-height:260px;width:100%;max-width:100%;overflow:hidden}
  #particleView .particle-space canvas{max-width:100%;height:min(44svh,360px)}
  #particleView .particle-stats{gap:8px;font-size:9px}
  /* Image and finance modules behave as native fullscreen panels. */
  #c32Panel{position:fixed!important;inset:0!important;top:0!important;right:0!important;bottom:0!important;left:0!important;width:100vw!important;max-width:100vw!important;height:100dvh!important;max-height:none!important;border:0!important;border-radius:0!important;padding-top:env(safe-area-inset-top);padding-bottom:env(safe-area-inset-bottom);overflow:hidden;z-index:12500}
  #c32Panel .c32-head{padding:14px 14px;gap:9px;min-height:54px;flex-shrink:0}
  #c32Panel .c32-head strong{font-size:12px;letter-spacing:.06em;white-space:normal}
  #c32Panel .c32-close{width:42px;height:42px;font-size:23px;flex-shrink:0}
  #c32Panel .c32-tabs{padding:10px 12px;min-height:48px;flex-shrink:0;gap:8px}
  #c32Panel .c32-tabs button{font-size:12px!important;padding:10px 13px;min-height:41px}
  #c32Panel .c32-body{padding:15px 14px calc(28px + env(safe-area-inset-bottom));overflow-y:auto;flex:1;-webkit-overflow-scrolling:touch}
  #c32Panel .c32-body h3{font-size:19px;line-height:1.2}
  #c32Panel .c32-body p{line-height:1.6}
  #c32Panel .c32-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;align-items:stretch}
  #c32Panel .c32-row>input:first-child{grid-column:1/-1;width:100%!important}
  #c32Panel .c32-row>button{min-height:44px;width:100%;white-space:normal;overflow-wrap:anywhere}
  #c32Panel .c32-grid{grid-template-columns:1fr}
  #c32Panel .c32-image{max-height:min(46vh,430px);object-fit:contain}
  #c32Panel #c32Watch{max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
  #c32Panel .c32-table{width:100%;min-width:0;font-size:11px}
  #c32Panel .c32-table td,#c32Panel .c32-table th{padding:11px 5px}
  #c32Panel .c32-canvas{width:100%;max-width:100%;height:185px}
  /* Chemistry and computer remain genuine fullscreen subviews of MAYA. */
  #c33Lab,#c33Gift{inset:0;position:fixed;width:100vw;height:100dvh;max-height:100dvh;overflow-y:auto;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom);-webkit-overflow-scrolling:touch}
  #c33Lab .c33-wrap{width:100%;max-width:100%;min-height:100%;border-radius:0;border-left:0;border-right:0;margin:0;overflow:visible}
  #c33Lab .c33-head,#c33Gift .c33-head{position:sticky;top:0;z-index:10;min-height:60px;padding:12px 14px;gap:10px;flex-wrap:wrap}
  #c33Lab .c33-head strong,#c33Gift .c33-head strong{font-size:12px;min-width:0;overflow-wrap:anywhere}
  #c33Lab .c33-head button,#c33Gift .c33-head button{min-height:42px;white-space:normal}
  #c33Lab .c33-content{padding:16px 12px 24px}
  #c33Lab .c33-grid{display:grid;grid-template-columns:minmax(0,1fr);gap:14px}
  #c33Lab .c33-card{padding:14px 12px}
  #c33Lab .c33-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;align-items:stretch}
  #c33Lab .c33-row>button{width:100%;min-height:46px;padding:11px 7px;line-height:1.3;white-space:normal;overflow-wrap:anywhere}
  #c33Lab .c33-row>input:not([type="file"]){grid-column:1/-1}
  #c33Lab .c33-tiles{grid-template-columns:repeat(2,minmax(0,1fr))}
  #c33Lab .c33-wizard{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
  #c33Lab .c33-wizard button{min-height:55px;font-size:12px;padding:10px 3px;white-space:normal}
  #c33Lab .c33-code-area{min-height:210px;max-width:100%}
  #c33Lab .c33-preview{height:min(65vh,480px)}
  #c33Lab .c33-stage{height:270px}
  #c33Gift .c33-gift-layout{width:100%;min-height:100%;padding:0 12px 24px;gap:14px}
  #c33Gift .c33-gift-actions{display:grid;grid-template-columns:minmax(0,1fr);gap:12px}
  #c33Gift .c33-gift-actions button{min-height:112px;max-width:100%;padding:14px;text-align:left;gap:12px}
  #c33Gift .c33-gift-actions button svg{width:42px;height:42px}
}
@media(max-width:370px){
  #particleView .particle-top h2{font-size:20px}
  #particleView #maya2Modes{grid-template-columns:repeat(2,minmax(0,1fr))}
  #c32Panel .c32-row,#c33Lab .c33-row{grid-template-columns:minmax(0,1fr)}
}
