/* SLAVEY_BG_V81_MODE_DOCK_FIX: normal-flow minimizer + single restore control. */
.topbar .brand-name, header .brand-name { white-space: nowrap; }
#slavey-v8-modes-launcher { display: none !important; }
@media (min-width: 900px) {
  /* V8 / existing dock both track the same pinned panel. */
  body.slavey-v8-modes-collapsed [data-em-desktop-modes-panel="true"] {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
  /* The original floating Modes control is the ONLY restore button. */
  body:not(.slavey-v8-modes-collapsed) [data-slavey-native-modes-trigger="true"] {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
  body.slavey-v8-modes-collapsed [data-slavey-native-modes-trigger="true"],
  body.slavey-v8-modes-collapsed[data-em-modes-dock-ready="true"] [data-em-desktop-modes-button="true"] {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    cursor: pointer !important;
  }
  /* A fallback is used ONLY when the app has no original Modes button. */
  body.slavey-v8-modes-collapsed #slavey-v8-modes-launcher:not([hidden]) {
    position: fixed !important;
    bottom: max(18px, env(safe-area-inset-bottom)) !important;
    right: 18px !important;
    z-index: 2070 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 49px !important;
    padding: 10px 19px !important;
    color: #e2f6ff !important;
    background: rgba(7,24,42,.96) !important;
    border: 1px solid rgba(67,163,216,.55) !important;
    border-radius: 13px !important;
    font: 700 15px/1.2 Inter,system-ui,sans-serif !important;
    box-shadow: 0 7px 25px #0007 !important;
    cursor: pointer !important;
  }
  /* This row reserves real space above the Streets / Satellite cards. */
  [data-em-desktop-modes-panel="true"] > .slavey-v81-modes-toolbar {
    position: relative !important;
    z-index: 3 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    flex: 0 0 42px !important;
    width: 100% !important;
    min-height: 42px !important;
    padding: 5px 8px !important;
    margin: 0 !important;
    border-bottom: 1px solid rgba(74,152,197,.15) !important;
    background: transparent !important;
  }
  [data-em-desktop-modes-panel="true"] .slavey-v81-modes-toolbar > .slavey-v8-minimize-modes {
    position: static !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 32px !important;
    width: 32px !important;
    height: 31px !important;
    padding: 0 !important;
    margin: 0 !important;
    transform: none !important;
    border: 1px solid rgba(83,132,158,.5) !important;
    border-radius: 9px !important;
    background: #122e45 !important;
    color: #e0f5ff !important;
    font: 700 22px/1 Inter,system-ui,sans-serif !important;
    cursor: pointer !important;
  }
  [data-em-desktop-modes-panel="true"] .slavey-v81-modes-toolbar > .slavey-v8-minimize-modes:hover {
    background: #1b435d !important;
  }
}
@media (max-width: 899px) {
  #slavey-v8-modes-launcher, .slavey-v81-modes-toolbar,
  .slavey-v8-minimize-modes { display: none !important; }
}

/* V8.2: protect the real minimize control against legacy overlay rules. */
@media (min-width: 900px) {
  [data-em-desktop-modes-panel="true"] .slavey-v81-modes-toolbar > button.slavey-v8-minimize-modes {
    pointer-events: auto !important;
    touch-action: manipulation !important;
  }
}

/* SLAVEY_BG_V85_DESKTOP_TOGGLE: bottom-right Modes is the sole toggle. */
@media (min-width: 900px) {
  body[data-em-modes-dock-ready="true"] [data-slavey-native-modes-trigger="true"],
  body [data-slavey-native-modes-trigger="true"] {
    display: flex !important;
    visibility: visible !important;
    pointer-events: auto !important;
    opacity: 1 !important;
    cursor: pointer !important;
  }
  [data-em-desktop-modes-panel="true"] > .slavey-v81-modes-toolbar,
  [data-em-desktop-modes-panel="true"] .slavey-v8-minimize-modes {
    display: none !important;
  }
  body #slavey-v8-modes-launcher:not([hidden]) {
    position: fixed !important;
    bottom: max(18px, env(safe-area-inset-bottom)) !important;
    right: 18px !important;
    z-index: 2100 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 49px !important;
    padding: 10px 19px !important;
    color: #e2f6ff !important;
    background: rgba(7,24,42,.96) !important;
    border: 1px solid rgba(67,163,216,.55) !important;
    border-radius: 13px !important;
    font: 700 15px/1.2 Inter,system-ui,sans-serif !important;
    box-shadow: 0 7px 25px #0007 !important;
    cursor: pointer !important;
  }
}
@media (max-width: 899px) {
  #slavey-v8-modes-launcher {display:none!important;}
}
