/* EMENG AI Ecommerce – independent responsive layer over the live glass skin.
 * Loaded last, without replacing the production workbench scripts or cached assets. */
html[data-emeng-ecommerce="1"] body .at-shell.at-tertiary-mode .at-main,
html[data-emeng-ecommerce="1"] body .at-shell.at-tertiary-mode .at-main :is(.rw-page,.rw-workspace,.rw-batch-body,.rw-new-batch,.rw-result,.rw-config,.at-ps-v2,.at-ps-layout,.at-ps-form,.at-ps-showcase){
  box-sizing:border-box;
  min-width:0;
  max-width:100%;
}
html[data-emeng-ecommerce="1"] body .at-shell.at-tertiary-mode .at-main :is(.rw-page,.at-ps-v2){margin-inline:auto}

/* The site supplies the left navigation. Do not reserve a third, empty grid column. */
@media(min-width:1121px){
  html[data-emeng-ecommerce="1"] body :is(#root,.at-shell).at-tertiary-mode .at-main .at-ps-v2:not(.at-generic-tool-v2){
    grid-template-columns:minmax(340px,.85fr) minmax(0,1.15fr)!important;
  }
  html[data-emeng-ecommerce="1"] body :is(#root,.at-shell).at-tertiary-mode .at-main .at-ps-v2:not(.at-generic-tool-v2) .at-ps-form{
    grid-column:1!important;
  }
  html[data-emeng-ecommerce="1"] body :is(#root,.at-shell).at-tertiary-mode .at-main .at-ps-v2:not(.at-generic-tool-v2) .at-ps-showcase{
    grid-column:2!important;
  }
}
@media(max-width:900px){
  /* Match the workspace's mobile grid; the 600px glass override must not restore a desktop rail. */
  html[data-emeng-ecommerce="1"] body :is(#root,.at-shell).at-tertiary-mode .at-main .rw-page:has(>.rw-shared-nav){
    grid-template-columns:minmax(0,1fr)!important;grid-template-rows:56px minmax(0,1fr)!important;
  }
  html[data-emeng-ecommerce="1"] body :is(#root,.at-shell).at-tertiary-mode .at-main .rw-page>.rw-shared-nav{
    display:block!important;position:fixed!important;inset:0 auto 0 0!important;
    width:min(86vw,320px)!important;height:100dvh!important;z-index:52!important;
    transform:translateX(-105%)!important;grid-column:auto!important;grid-row:auto!important;
  }
  html[data-emeng-ecommerce="1"] body :is(#root,.at-shell).at-tertiary-mode .at-main .rw-page.mobile-nav-open>.rw-shared-nav{transform:translateX(0)!important}
  html[data-emeng-ecommerce="1"] body .at-shell.at-tertiary-mode .at-main .rw-page>.rw-mobile-nav-toggle{display:inline-flex!important}
  html[data-emeng-ecommerce="1"] body .at-shell.at-tertiary-mode .at-main .rw-page>:is(.rw-topbar,.rw-workspace,.rw-batch-body){grid-column:1!important}
  html[data-emeng-ecommerce="1"] body .at-shell.at-tertiary-mode .at-main .rw-page>:is(.rw-workspace,.rw-batch-body){grid-row:2!important;overflow:auto!important}
  html[data-emeng-ecommerce="1"] body .at-shell.at-tertiary-mode .at-main :is(.rw-workspace,.rw-batch-body,.at-ps-layout){
    width:100%!important;max-width:100%!important;min-width:0!important;
  }
  html[data-emeng-ecommerce="1"] body .at-shell.at-tertiary-mode .at-main .rw-batch-body{
    display:grid!important;grid-template-columns:minmax(0,1fr)!important;
  }
  html[data-emeng-ecommerce="1"] body .at-shell.at-tertiary-mode .at-main .at-ps-v2 .at-ps-action{
    left:0!important;right:0!important;width:100%!important;max-width:100%!important;box-sizing:border-box!important;
    padding-bottom:max(8px,env(safe-area-inset-bottom))!important;
  }
}
@media(max-width:599px){
  html[data-emeng-ecommerce="1"] body .at-shell.at-tertiary-mode .at-main :is(.rw-workspace,.rw-config-body,.rw-result-content){
    padding-inline:clamp(10px,3vw,16px)!important;
  }
  html[data-emeng-ecommerce="1"] body .at-shell.at-tertiary-mode .at-main .rw-command-meta{
    grid-template-columns:minmax(0,1fr)!important;
  }
  html[data-emeng-ecommerce="1"] body .at-shell.at-tertiary-mode .at-main :is(.rw-topbar,.rw-result-header,.at-ps-head,.at-ps-module-actions){
    flex-wrap:wrap!important;min-width:0;
  }
  html[data-emeng-ecommerce="1"] body .at-shell.at-tertiary-mode .at-main :is(.rw-input,.rw-textarea,.rw-select,.at-ps-form input,.at-ps-form select,.at-ps-form textarea){
    box-sizing:border-box;min-width:0;max-width:100%;
  }
  html[data-emeng-ecommerce="1"] body .at-shell.at-tertiary-mode .at-main .rw-metrics{
    grid-template-columns:repeat(auto-fit,minmax(min(100%,150px),1fr))!important;
  }
  html[data-emeng-ecommerce="1"] body :is(.rw-modal>section,.at-template-modal>section){
    box-sizing:border-box;max-width:calc(100vw - 20px)!important;min-width:0!important;
  }
  html[data-emeng-ecommerce="1"] body .at-shell.at-tertiary-mode .at-main :is(button,[role="button"]){
    min-height:40px;
  }
}
@media(prefers-reduced-motion:reduce){
  html[data-emeng-ecommerce="1"] body .at-shell.at-tertiary-mode .at-main :is(.rw-page,.at-ps-v2){
    scroll-behavior:auto!important;
  }
}

/* Layout only: preserve current glass skin, theme, background and controls.
   Append after responsive-scale.css. Product-set page only, not generic tools. */
@media(min-width:901px){
  html[data-emeng-ecommerce="1"] body :is(#root,.at-shell).at-tertiary-mode .at-main .at-ps-v2:not(.at-generic-tool-v2){
    display:grid!important;grid-template-rows:64px minmax(0,1fr) auto!important;min-width:0!important;
  }
  html[data-emeng-ecommerce="1"] body :is(#root,.at-shell).at-tertiary-mode .at-main .at-ps-v2:not(.at-generic-tool-v2)>.at-ps-layout{display:contents!important}
  html[data-emeng-ecommerce="1"] body :is(#root,.at-shell).at-tertiary-mode .at-main .at-ps-v2:not(.at-generic-tool-v2)>.at-ps-head{grid-column:1/-1!important;grid-row:1!important}
  html[data-emeng-ecommerce="1"] body :is(#root,.at-shell).at-tertiary-mode .at-main .at-ps-v2:not(.at-generic-tool-v2) .at-ps-form{grid-row:2!important;height:auto!important;max-height:none!important;min-height:0!important;min-width:0!important;width:auto!important;padding-bottom:20px!important;overflow:auto!important}
  html[data-emeng-ecommerce="1"] body :is(#root,.at-shell).at-tertiary-mode .at-main .at-ps-v2:not(.at-generic-tool-v2) .at-ps-showcase{grid-row:2/4!important;height:auto!important;max-height:none!important;min-height:0!important;min-width:0!important;overflow:auto!important}
  html[data-emeng-ecommerce="1"] body :is(#root,.at-shell).at-tertiary-mode .at-main .at-ps-v2:not(.at-generic-tool-v2)>.at-ps-action{position:static!important;inset:auto!important;grid-row:3!important;width:auto!important;min-width:0!important;max-width:100%!important;box-sizing:border-box!important;z-index:auto!important}
}
@media(min-width:1121px){
  html[data-emeng-ecommerce="1"] body :is(#root,.at-shell).at-tertiary-mode .at-main .at-ps-v2:not(.at-generic-tool-v2){grid-template-columns:168px minmax(340px,.85fr) minmax(0,1.15fr)!important}
  html[data-emeng-ecommerce="1"] body :is(#root,.at-shell).at-tertiary-mode .at-main .at-ps-v2:not(.at-generic-tool-v2) .rw-shared-nav{grid-column:1!important;grid-row:2/4!important;height:auto!important;width:168px!important;position:relative!important;inset:auto!important;transform:none!important}
  html[data-emeng-ecommerce="1"] body :is(#root,.at-shell).at-tertiary-mode .at-main .at-ps-v2:not(.at-generic-tool-v2) .at-ps-form,
  html[data-emeng-ecommerce="1"] body :is(#root,.at-shell).at-tertiary-mode .at-main .at-ps-v2:not(.at-generic-tool-v2)>.at-ps-action{grid-column:2!important}
  html[data-emeng-ecommerce="1"] body :is(#root,.at-shell).at-tertiary-mode .at-main .at-ps-v2:not(.at-generic-tool-v2) .at-ps-showcase{grid-column:3!important}
}
@media(min-width:901px) and (max-width:1120px){
  html[data-emeng-ecommerce="1"] body :is(#root,.at-shell).at-tertiary-mode .at-main .at-ps-v2:not(.at-generic-tool-v2){grid-template-columns:minmax(340px,.85fr) minmax(0,1.15fr)!important}
  html[data-emeng-ecommerce="1"] body :is(#root,.at-shell).at-tertiary-mode .at-main .at-ps-v2:not(.at-generic-tool-v2) .at-ps-form,
  html[data-emeng-ecommerce="1"] body :is(#root,.at-shell).at-tertiary-mode .at-main .at-ps-v2:not(.at-generic-tool-v2)>.at-ps-action{grid-column:1!important}
  html[data-emeng-ecommerce="1"] body :is(#root,.at-shell).at-tertiary-mode .at-main .at-ps-v2:not(.at-generic-tool-v2) .at-ps-showcase{grid-column:2!important}
}
@media(max-width:900px){
  html[data-emeng-ecommerce="1"] body :is(#root,.at-shell).at-tertiary-mode .at-main .at-ps-v2:not(.at-generic-tool-v2)>.at-ps-layout{display:block!important;width:100%!important;min-width:0!important}
  html[data-emeng-ecommerce="1"] body :is(#root,.at-shell).at-tertiary-mode .at-main .at-ps-v2:not(.at-generic-tool-v2) :is(.at-ps-form,.at-ps-showcase){position:relative!important;inset:auto!important;float:none!important;width:100%!important;max-width:100%!important;min-width:0!important;height:auto!important;box-sizing:border-box!important}
  html[data-emeng-ecommerce="1"] body :is(#root,.at-shell).at-tertiary-mode .at-main .at-ps-v2:not(.at-generic-tool-v2) .at-ps-showcase{padding-bottom:112px!important}
  html[data-emeng-ecommerce="1"] body :is(#root,.at-shell).at-tertiary-mode .at-main .at-ps-v2:not(.at-generic-tool-v2)>.at-ps-action{left:0!important;right:0!important;width:100%!important;min-width:0!important;max-width:100%!important;box-sizing:border-box!important}
}
