/* 3D Studio AI v1.9.5 · iPhone interaction reliability */

/* Force every tool card to start exactly on a viewport-width boundary.
   Inline content never gets to widen a slide or shift the snap point. */
#tools-deck{
  width:100%!important;min-width:0!important;
  scroll-snap-type:x mandatory!important;
  scroll-padding:0!important;
  gap:0!important;
  overflow-x:auto!important;
  overscroll-behavior-x:contain;
}
#tools-deck>.tool-card{
  flex:0 0 100%!important;
  box-sizing:border-box!important;
  width:100%!important;min-width:100%!important;max-width:100%!important;
  margin:0!important;
  scroll-snap-align:start!important;
  scroll-snap-stop:always;
}
#tools-deck>.tool-card :is(input,select,textarea,fieldset){max-width:100%;box-sizing:border-box;}
#tools-deck .section-heading{min-width:0;}
#tools-deck>.tool-card .tool-desc{overflow-wrap:anywhere;}

/* Explicit delete-model button, distinct from non-destructive hide object. */
.viewport-top .model-title{min-width:0;flex:1 1 auto;}
.viewport-top .model-title>span:last-child{min-width:0;}
.model-delete{
 display:inline-flex;align-items:center;justify-content:center;gap:5px;
 border:1px solid #ad5868;border-radius:10px;background:#3b202e;
 color:#ffdce1;min-height:44px;min-width:48px;flex:none;
 padding:8px 11px;font:700 12px/1.2 system-ui,sans-serif;cursor:pointer;
 touch-action:manipulation;
}
.model-delete:not(:disabled):active{background:#663242;}
.model-delete:disabled{opacity:.38;cursor:not-allowed;}
@media(max-width:650px){.model-delete .model-delete-label{display:none;}.model-delete{min-width:44px;padding:8px;}.viewport-top{gap:7px;}}

/* The native iOS numeric pad may omit minus. This companion bar supplies signs,
   decimal separators and editing controls while leaving the keyboard intact. */
#numeric-toolbar[hidden],#fullscreen-tool-sheet[hidden]{display:none!important;}
.numeric-toolbar{
 position:fixed;left:max(8px,env(safe-area-inset-left,0px));right:max(8px,env(safe-area-inset-right,0px));
 bottom:10px;z-index:2147483001;box-sizing:border-box;
 display:flex;align-items:center;justify-content:center;gap:5px;
 max-width:650px;margin:0 auto;padding:7px;
 background:#152b3c;border:1px solid #61a3c9;border-radius:14px;
 box-shadow:0 5px 28px #000b;touch-action:manipulation;
}
.numeric-toolbar button{
 flex:1 1 0;min-width:0;min-height:43px;border:1px solid #456c88;border-radius:9px;
 background:#263e54;color:#eaf6ff;font:750 16px system-ui,sans-serif;
 padding:7px 3px;touch-action:manipulation;white-space:nowrap;
}
.numeric-toolbar button[data-numeric-key="minus"],
.numeric-toolbar button[data-numeric-key="sign"]{color:#ffe3a6;}
.numeric-toolbar button[data-numeric-key="done"]{flex:1.35;background:#287da5;color:#fff;font-size:12px;}

/* True editor overlay above the immersive viewport. Original panels are MOVED
   into the dialog, not cloned, and restored to carousel when dismissed. */
.fullscreen-tool-sheet{
 position:fixed;inset:0;z-index:2147482000;box-sizing:border-box;
 display:flex;align-items:center;justify-content:center;
 padding:
   max(105px,calc(var(--tg-content-safe-area-inset-top,0px) + 76px))
   max(10px,env(safe-area-inset-right,0px))
   max(86px,calc(var(--sheet-keyboard,0px) + 10px))
   max(10px,env(safe-area-inset-left,0px));
 background:rgba(2,9,19,.70);backdrop-filter:blur(4px);
 touch-action:pan-y;overscroll-behavior:contain;
}
.tool-sheet-panel{
 width:min(650px,100%);max-height:100%;min-height:0;display:flex;flex-direction:column;
 background:#101f31;border:1px solid #5385a3;border-radius:17px;
 box-shadow:0 16px 56px #000b;overflow:hidden;
}
.tool-sheet-head{
 flex:none;min-height:60px;display:flex;align-items:center;justify-content:space-between;gap:10px;
 padding:9px 11px 9px 16px;background:#19374f;border-bottom:1px solid #416e89;
}
.tool-sheet-head strong{min-width:0;color:#e2f6ff;font-size:15px;line-height:1.2;overflow-wrap:anywhere;}
.tool-sheet-close{min-width:44px;min-height:44px;border:1px solid #678ba0;background:#2a4b65;
 color:#fff;border-radius:10px;font:800 17px system-ui,sans-serif;touch-action:manipulation;}
.tool-sheet-scroll{
 flex:1 1 auto;min-height:0;overflow-y:auto;overflow-x:hidden;
 -webkit-overflow-scrolling:touch;overscroll-behavior:contain;touch-action:pan-y;
 padding:0;scrollbar-width:thin;
}
.tool-sheet-scroll>.tool-card.tool-sheet-ported{
 display:block!important;position:static!important;
 width:100%!important;max-width:100%!important;min-width:0!important;
 margin:0!important;padding:16px!important;
 border:0!important;border-radius:0!important;box-sizing:border-box!important;
 transform:none!important;scroll-snap-align:none!important;
}
.tool-sheet-scroll>.tool-card :is(input,select,textarea,fieldset){max-width:100%;box-sizing:border-box;}
.tool-sheet-scroll>.tool-card :is(input,select,textarea){font-size:16px;}
.tool-sheet-scroll>.tool-card .section-heading{min-width:0;}
.tool-sheet-scroll>.tool-card .tool-desc{overflow-wrap:anywhere;}
@media(max-height:620px) and (orientation:landscape){
 .fullscreen-tool-sheet{padding-top:65px;padding-bottom:max(12px,var(--sheet-keyboard,0px));}
 .tool-sheet-head{min-height:48px;padding:4px 10px;}
}
@media(prefers-reduced-motion:reduce){
 #tools-deck{scroll-behavior:auto;}
}
