/* MISTER FAST V38.2.3 — Safe Tool Migration / V38.1 layout restore */
:root{
  --mf3823-blue:#003DA5;
  --mf3823-yellow:#FFC400;
  --mf3823-white:#FFFFFF;
  --mf3823-ink:#163B68;
  --mf3823-line:#D9E6F5;
}

/* Keep advanced modules out of the normal page flow. */
body.mf-v3823-ready .mf-v343-advanced-section{
  display:none !important;
}

/* Show only the selected tool as a fixed workspace overlay.
   The original DOM node is not moved, preserving existing JS/data bindings. */
body.mf-v3823-tool-open .mf-v343-advanced-section.mf-v3823-active-tool{
  display:block !important;
  position:fixed !important;
  top:84px !important;
  right:18px !important;
  bottom:18px !important;
  width:min(760px,calc(100vw - 36px)) !important;
  max-width:760px !important;
  margin:0 !important;
  overflow:auto !important;
  z-index:100002 !important;
  border:1px solid var(--mf3823-line) !important;
  border-radius:22px !important;
  background:var(--mf3823-white) !important;
  box-shadow:0 24px 70px rgba(0,61,165,.22) !important;
  color:var(--mf3823-ink) !important;
}

.mf-v3823-backdrop{
  position:fixed;
  inset:0;
  z-index:100000;
  background:rgba(0,61,165,.16);
  backdrop-filter:blur(2px);
}

.mf-v3823-close{
  position:fixed;
  top:94px;
  right:30px;
  z-index:100004;
  width:42px;
  height:42px;
  border:1px solid var(--mf3823-line);
  border-radius:14px;
  background:var(--mf3823-yellow);
  color:var(--mf3823-blue);
  font-size:24px;
  font-weight:900;
  cursor:pointer;
  box-shadow:0 10px 30px rgba(0,61,165,.16);
}

body.mf-v3823-tool-open{
  overflow:hidden;
}

@media (max-width:768px){
  body.mf-v3823-tool-open .mf-v343-advanced-section.mf-v3823-active-tool{
    top:auto !important;
    left:0 !important;
    right:0 !important;
    bottom:0 !important;
    width:100% !important;
    max-width:none !important;
    max-height:82vh !important;
    border-radius:24px 24px 0 0 !important;
  }
  .mf-v3823-close{
    top:auto;
    right:14px;
    bottom:calc(82vh - 54px);
  }
}
