/* My Tuner v577 — floating ECU editor visual fixes (desktop only).
   Preserve catalog accordion, ECU binary state, and mobile controls. */
@media (min-width:701px) {
  /* Never select row/axis text instead of ECU cells (blue OS highlight). */
  html body.mrs-desktop #mrsMapWindowsV565 .mrs-mdi-window .mrs-mdi-matrix,
  html body.mrs-desktop #mrsMapWindowsV565 .mrs-mdi-window .mrs-mdi-matrix * {
    -webkit-user-select:none!important;user-select:none!important;-webkit-touch-callout:none!important;
  }
  html body.mrs-desktop #mrsMapWindowsV565 .mrs-mdi-window td[data-map-cell].is-selected {
    outline:2px solid #ff425e!important;outline-offset:-2px!important;
    box-shadow:inset 0 0 0 1px #fff!important;
    background:var(--mdi-heat,#133652)!important;
  }
  /* Only selected data cells get a selection marker. Axes are never selected. */
  html body.mrs-desktop #mrsMapWindowsV565 .mrs-mdi-window .mrs-mdi-matrix th {
    outline:none!important;box-shadow:none!important;
  }

  /* A mixed view has 2D table on the LEFT and proportional 3D on the RIGHT. */
  html body.mrs-desktop #mrsMapWindowsV565 .mrs-mdi-window .mrs-mdi-content.mrs-v574-mixed {
    display:grid!important;flex-direction:row!important;
    grid-template-columns:minmax(0,55fr) minmax(0,45fr)!important;
    grid-template-rows:minmax(0,1fr)!important;
    align-items:stretch!important;justify-content:stretch!important;
    gap:6px!important;box-sizing:border-box!important;
    width:100%!important;height:100%!important;min-width:0!important;min-height:0!important;
    padding:0!important;overflow:hidden!important;
  }
  html body.mrs-desktop #mrsMapWindowsV565 .mrs-mdi-window .mrs-mdi-content.mrs-v574-mixed > .mrs-mdi-table {
    display:block!important;grid-column:1!important;grid-row:1!important;
    box-sizing:border-box!important;width:100%!important;height:100%!important;
    min-width:0!important;min-height:0!important;max-width:100%!important;max-height:100%!important;
    flex:none!important;overflow:auto!important;
    border-right:1px solid #364658!important;
  }
  html body.mrs-desktop #mrsMapWindowsV565 .mrs-mdi-window .mrs-mdi-content.mrs-v574-mixed > .mrs-mdi-canvas {
    display:block!important;grid-column:2!important;grid-row:1!important;
    box-sizing:border-box!important;
    position:relative!important;width:100%!important;height:100%!important;
    min-width:0!important;min-height:0!important;max-width:100%!important;max-height:100%!important;
    flex:none!important;object-fit:contain!important;
    background:#0a131e!important;
  }
  html body.mrs-desktop #mrsMapWindowsV565 .mrs-mdi-window .mrs-mdi-content.mrs-v574-mixed > .mrs-v574-graph {display:none!important}
  html body.mrs-desktop #mrsMapWindowsV565 .mrs-mdi-window .mrs-mdi-content.mrs-v574-mixed .mrs-mdi-matrix th,
  html body.mrs-desktop #mrsMapWindowsV565 .mrs-mdi-window .mrs-mdi-content.mrs-v574-mixed .mrs-mdi-matrix td {
    min-width:54px!important;padding:3px 4px!important;
  }

  /* Real workspace maximization: fill usable area to the stage boundaries. */
  html body.mrs-desktop:has(#mrsMapWindowsV565 .mrs-mdi-window.is-maximized) #mrsMapWindowsV565 {
    position:fixed!important;
    top:69px!important;right:0!important;bottom:0!important;left:var(--mrs-map-sidebar-offset-v577,190px)!important;
    width:auto!important;height:auto!important;inset:69px 0 0 var(--mrs-map-sidebar-offset-v577,190px)!important;
    padding:0!important;margin:0!important;overflow:visible!important;
  }
  html body.mrs-desktop:has(#mrsMapWindowsV565 .mrs-mdi-window.is-maximized) #mrsMdiLayerV565 {
    position:absolute!important;inset:0!important;
    overflow:visible!important;pointer-events:none!important;
  }
  html body.mrs-desktop #mrsMapWindowsV565 .mrs-mdi-window.is-maximized {
    position:absolute!important;top:0!important;left:0!important;right:0!important;bottom:0!important;
    width:100%!important;height:100%!important;min-width:0!important;min-height:0!important;
    max-width:100%!important;max-height:100%!important;margin:0!important;padding:0!important;
    border:0!important;border-radius:0!important;resize:none!important;
    z-index:1000!important;
  }
  html body.mrs-desktop #mrsMapWindowsV565 .mrs-mdi-window.is-maximized .mrs-mdi-content {
    flex:1!important;min-height:0!important;
  }

  /* Window controls are equal-sized and use plain, legible glyphs. */
  html body.mrs-desktop #mrsMapWindowsV565 .mrs-mdi-window .mrs-mdi-actions {
    display:flex!important;align-items:center!important;gap:5px!important;
    z-index:50!important;flex-shrink:0!important;
  }
  html body.mrs-desktop #mrsMapWindowsV565 .mrs-mdi-window .mrs-mdi-actions .mrs-v577-window-control {
    display:inline-flex!important;align-items:center!important;justify-content:center!important;
    position:relative!important;flex:0 0 auto!important;
    width:33px!important;min-width:33px!important;height:29px!important;min-height:29px!important;
    padding:0!important;border:1px solid #697687!important;border-radius:6px!important;
    background:linear-gradient(180deg,#273746,#17232e)!important;
    color:#f4f8fd!important;font:750 19px/1 "Segoe UI",Arial,sans-serif!important;
    box-shadow:inset 0 1px 0 #ffffff12!important;opacity:1!important;visibility:visible!important;
    cursor:pointer!important;
  }
  html body.mrs-desktop #mrsMapWindowsV565 .mrs-mdi-window .mrs-mdi-actions .mrs-v577-window-control[data-mdi-window-action="close"] {
    background:linear-gradient(180deg,#cd2c48,#921a30)!important;border-color:#f1536c!important;
    color:#fff!important;font-size:22px!important;
  }
  html body.mrs-desktop #mrsMapWindowsV565 .mrs-mdi-window .mrs-mdi-actions .mrs-v577-window-control:hover {
    filter:brightness(1.3)!important;
  }
  html body.mrs-desktop #mrsMapWindowsV565 .mrs-mdi-window .mrs-mdi-titlebar {
    min-height:36px!important;height:36px!important;padding-right:8px!important;
  }

  html body.mrs-desktop #mrsMapWindowsV565 .mrs-mdi-maptools {
    gap:5px!important;min-height:0!important;align-content:center!important;
    padding:5px 8px!important;
  }
  html body.mrs-desktop #mrsMapWindowsV565 .mrs-mdi-maptools .mrs-v577-tool {
    display:inline-flex!important;align-items:center!important;justify-content:center!important;
    flex:0 0 auto!important;min-height:28px!important;
    border:1px solid #6b5562!important;border-radius:5px!important;
    background:#221a25!important;color:#f2f5fa!important;
    font:700 10.5px/1.2 "Segoe UI",Arial,sans-serif!important;
    padding:5px 9px!important;cursor:pointer!important;
  }
  html body.mrs-desktop #mrsMapWindowsV565 .mrs-mdi-maptools .mrs-v577-tool:hover{
    border-color:#ef4d67!important;background:#622032!important;
  }

  #mrsV577InterpolationHelp[hidden]{display:none!important}
  #mrsV577InterpolationHelp{
    position:fixed!important;inset:0!important;display:flex!important;
    align-items:center!important;justify-content:center!important;
    z-index:2147483600!important;box-sizing:border-box!important;
    background:#05080dde!important;padding:16px!important;
  }
  #mrsV577InterpolationHelp .mrs-v577-welcome{
    box-sizing:border-box!important;width:min(550px,100%)!important;max-height:90dvh!important;overflow:auto!important;
    border:1px solid #b44058!important;border-radius:10px!important;
    background:#141d27!important;box-shadow:0 24px 90px #000e!important;
    padding:18px!important;color:#f0f4f9!important;font:500 13px/1.55 "Segoe UI",Arial,sans-serif!important;
  }
  #mrsV577InterpolationHelp .mrs-v577-welcome header{
    display:flex!important;align-items:center!important;justify-content:space-between!important;
    border-bottom:1px solid #374354!important;padding-bottom:12px!important;
  }
  #mrsV577InterpolationHelp .mrs-v577-welcome h2{font:750 19px "Segoe UI",Arial,sans-serif!important;margin:0!important}
  #mrsV577InterpolationHelp .mrs-v577-welcome button{
    padding:9px 12px!important;border:1px solid #8d4557!important;border-radius:6px!important;
    color:#fff!important;background:#642139!important;cursor:pointer!important;
    font:700 12px "Segoe UI",Arial,sans-serif!important;
  }
  #mrsV577InterpolationHelp .mrs-v577-welcome footer{display:flex!important;justify-content:space-between!important;gap:12px!important;margin-top:16px!important}
  /* Keep the real interpolation dialog above every floating map window. */
  #mrsDirectInterpolationModal:not([hidden]),#mrsInterpolationModal:not([hidden]){
    z-index:2147483550!important;
  }
}
@media(min-width:701px) and (max-width:1050px){
  html body.mrs-desktop:has(#mrsMapWindowsV565 .mrs-mdi-window.is-maximized) #mrsMapWindowsV565 {
    left:153px!important;inset:69px 0 0 153px!important;
  }
}
