/* Responsive composition fixes for imported product and corporate sources.
   Corporate chrome remains owned exclusively by mncm-corporate-shell.js. */

/* Product navigation is integrated into the approved homepage header on wide
   screens. Constrained layouts use a separate product popover; the corporate
   MENU remains byte-for-byte corporate and never receives product links. */
.mncm-integrated-product-nav a:hover,.mncm-integrated-product-nav a[aria-current="page"],.mncm-integrated-product-nav a:focus-visible{color:var(--product-accent)}
.mncm-integrated-product-nav a:focus-visible{outline:2px solid var(--product-accent);outline-offset:3px}
.track-header>.mncm-integrated-product-nav{display:flex;align-items:center;justify-content:center;gap:clamp(12px,1.35vw,24px);flex:1 1 auto;min-width:0;overflow:hidden}
.track-header>.mncm-integrated-product-nav a{display:flex;align-items:center;min-height:44px;min-width:0;white-space:nowrap;font-size:clamp(9px,.72vw,11px);letter-spacing:.08em;text-transform:uppercase}
.mncm-product-menu-button{display:none}
.mncm-product-popover{display:none}
@media(max-width:1199px){
  .track-header>.mncm-integrated-product-nav{display:none}
  .mncm-product-menu-button{display:flex;align-items:center;gap:8px;max-width:148px;min-height:42px;padding:0 11px;border:1px solid #ffffff24;border-radius:999px;background:#080d157a;color:#f5f6f7;font-size:10px;font-weight:650;letter-spacing:.08em;text-transform:uppercase;white-space:nowrap;overflow:hidden}
  .mncm-product-menu-button>span:first-child{overflow:hidden;text-overflow:ellipsis}
  .mncm-product-menu-button:focus-visible{outline:3px solid var(--product-accent);outline-offset:4px}
  .mncm-product-menu-chevron{width:7px;height:7px;flex:none;border-right:1px solid;border-bottom:1px solid;transform:rotate(45deg) translateY(-2px);transition:transform .2s ease}
  .mncm-product-menu-button[aria-expanded="true"] .mncm-product-menu-chevron{transform:rotate(225deg) translate(-1px,-1px)}
  body>.mncm-product-popover{position:fixed;z-index:99;top:88px;right:clamp(18px,4vw,48px);display:grid;width:min(430px,calc(100vw - 36px));max-height:calc(100svh - 106px);grid-template-columns:repeat(2,minmax(0,1fr));gap:0 20px;padding:18px 22px;overflow:auto;border:1px solid color-mix(in srgb,var(--product-accent) 36%,#ffffff20);background:rgba(6,10,16,.97);box-shadow:0 24px 70px #000b;backdrop-filter:blur(22px) saturate(120%)}
  body>.mncm-product-popover[hidden]{display:none!important}
  body>.mncm-product-popover a{display:flex;align-items:center;min-height:48px;border-bottom:1px solid #ffffff18;color:#c5cbd3;font-size:13px;line-height:1.35}
}

/* Imported light themes and current-link styles must not override the exact
   opacity state calculated by the recovered homepage controller. */
html body.track-cinematic-top .track-header[data-track-header]{background:rgb(5 9 14 / var(--header-opacity))!important}
html body.track-cinematic-top .track-header[data-track-header][data-scroll-state="top"],
html body.track-cinematic-top.menu-open .track-header[data-track-header][data-scroll-state="top"]{--header-opacity:0!important;background-color:transparent!important;background-image:none!important;border-color:transparent!important;box-shadow:none!important;-webkit-backdrop-filter:none!important;backdrop-filter:none!important}
html body.track-cinematic-top .track-header[data-track-header][data-scroll-state="top"]::before,
html body.track-cinematic-top .track-header[data-track-header][data-scroll-state="top"]::after{background:transparent!important;border:0!important;box-shadow:none!important;-webkit-backdrop-filter:none!important;backdrop-filter:none!important}
html body.track-cinematic-top .track-header[data-track-header][data-scroll-state="top"] :is(.brand,.header-end,.mncm-integrated-product-nav){background:transparent!important;box-shadow:none!important;-webkit-backdrop-filter:none!important;backdrop-filter:none!important}
/* Direct React roots previously reserved the header height, leaving a plain
   body-colour strip behind an otherwise transparent header. Cinematic routes
   begin at the viewport top so their actual page surface remains visible. */
body.mncm-shared-corporate-shell.track-cinematic-top>#root{padding-top:0!important}
.track-header :is(.quick-nav a,.all-link,.mncm-integrated-product-nav a)[aria-current]{border-bottom-color:transparent!important;box-shadow:none!important;text-decoration:none!important}
.mncm-product-popover a[aria-current]{box-shadow:none!important;text-decoration:none!important}
.track-header :is(.quick-nav a,.all-link,.mncm-integrated-product-nav a)[aria-current]::before,
.track-header :is(.quick-nav a,.all-link,.mncm-integrated-product-nav a)[aria-current]::after,
.mncm-product-popover a[aria-current]::before,
.mncm-product-popover a[aria-current]::after{content:none!important;display:none!important}

/* Bridge the exact homepage-scene accents into the variables already used by
   each imported application. Layout, content, and application behavior stay
   under the original source; only the unrelated generic accent defaults are
   replaced. */
body[data-mncm-integrated-bolt="websites"]{--primary:24.462 100% 74.51%;--ring:24.462 100% 74.51%;--product-accent:#ffb27d}
body[data-mncm-integrated-bolt="websites"] #root .text-brand{color:#ffb27d}
body[data-mncm-integrated-bolt="websites"] #root .bg-brand{background-color:#ffb27d;color:#15100c}
body[data-mncm-integrated-bolt="websites"] #root .bg-brand-soft{background-color:rgba(255,178,125,.1)}
body[data-mncm-integrated-bolt="studio"]{--accent:#c5a4ff;--accent-bright:#d8c2ff;--accent-dim:#9f74eb;--accent-glow:rgba(197,164,255,.18);--product-accent:#c5a4ff}
body[data-mncm-integrated-bolt="recover"]{--accent:38.462 100% 77.059%;--ring:38.462 100% 77.059%;--product-accent:#ffd58a}
body[data-mncm-integrated-bolt="engineer"]{--primary:223.361 100% 76.667%;--accent:223.361 100% 76.667%;--ring:223.361 100% 76.667%;--product-accent:#88a9ff}
body[data-mncm-integrated-bolt="nova"]{--primary:192.632 100% 77.647%;--accent:192.632 100% 77.647%;--ring:192.632 100% 77.647%;--nova-accent:#8de7ff;--nova-accent-soft:#58bfd9;--nova-accent-end:#c1f3ff;--nova-accent-glow:rgba(141,231,255,.45);--product-accent:#8de7ff}
body[data-mncm-integrated-bolt="simulation"]{--primary:168.785 69.935% 70%;--ring:168.785 69.935% 70%;--product-accent:#7de8d4}
body[data-mncm-integrated-bolt="energy"]{--product-accent:#8fe7d0}
body[data-mncm-integrated-bolt="nudge"]{--product-accent:#e3a9e7}
body[data-mncm-integrated-bolt="research"]{--product-accent:#dce6ee}
@media (max-width:600px){
  body.mncm-shared-corporate-shell.track-cinematic-top>#root{padding-top:0!important}
  body>.mncm-product-popover{top:76px;right:12px;width:calc(100vw - 24px);max-height:calc(100svh - 88px);grid-template-columns:minmax(0,1fr);padding:12px 18px}
  .mncm-product-menu-button{max-width:90px;padding-inline:9px}
  .track-header[data-product-navigation="research"] .brand img{width:96px!important}
  .track-header[data-product-navigation="research"] .header-end{gap:2px}
  .track-header[data-product-navigation="research"] .menu-button{min-width:74px!important}
}
@media (max-width: 600px) {
  body[data-mncm-integrated-bolt="corporate"] #root h2 {
    max-width: 100%;
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: clamp(2rem, 9vw, 2.25rem);
  }

  body[data-mncm-integrated-bolt="corporate"] #root .flex.items-end.justify-between > * {
    min-width: 0;
    max-width: 100%;
  }

  body[data-mncm-integrated-bolt="engineer"] #root .grid.gap-px.overflow-hidden {
    min-width: 0;
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body[data-mncm-integrated-bolt="engineer"] #root .grid.gap-px.overflow-hidden > button {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  body[data-mncm-integrated-bolt="engineer"] #root .flex.gap-2.overflow-x-auto {
    flex-wrap: wrap;
    overflow-x: visible;
  }

  body[data-mncm-integrated-bolt="engineer"] #root .flex.gap-2.overflow-x-auto > button {
    flex: 1 1 calc(50% - .5rem);
    min-width: 0;
  }

  /* Studio's alternating desktop reveal offsets leave every other feature
     shifted outside the mobile viewport. Mobile uses a stable vertical flow. */
  body[data-mncm-integrated-bolt="studio"] #root .flex.flex-col.gap-8 > .flex-1 {
    transform: none !important;
  }
}
