.thmail-legacy-menu-control {
  display: none !important;
}

#thmailEdgeToggle {
  position: fixed;
  width: 26px;
  height: 42px;
  border: 1px solid rgba(12, 32, 61, .18);
  border-left: none;
  border-radius: 0 12px 12px 0;
  background: #f5f9ff;
  color: #16365f;
  box-shadow: 0 6px 16px rgba(12, 32, 61, .14);
  cursor: pointer;
  display: flex !important;
  align-items: center;
  justify-content: center;
  z-index: 10002;
  transition:
    left .2s ease,
    transform .16s ease,
    box-shadow .16s ease,
    background .16s ease;
}

#thmailEdgeToggle:hover {
  transform: translateX(2px);
  background: #fff;
  box-shadow: 0 8px 18px rgba(12, 32, 61, .18);
}

#thmailEdgeToggle span {
  font-size: 17px;
  line-height: 1;
  font-weight: 700;
}

.thmail-sidebar-overlay {
  position: fixed;
  inset: 0;
  border: 0;
  padding: 0;
  background: rgba(5, 23, 45, .32);
  z-index: 9997;
  cursor: default;
}

.thmail-sidebar-overlay[hidden] {
  display: none !important;
}

@media (min-width: 901px) {
  #sidebar {
    transition:
      width .2s ease,
      min-width .2s ease,
      transform .2s ease,
      opacity .16s ease,
      padding .2s ease;
  }

  body.thmail-sidebar-is-collapsed #sidebar {
    width: 0 !important;
    min-width: 0 !important;
    max-width: 0 !important;
    flex-basis: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    border-right-width: 0 !important;
    transform: translateX(-102%) !important;
    opacity: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
  }

  body.thmail-sidebar-is-collapsed #appView {
    grid-template-columns: 0 minmax(0, 1fr) !important;
    column-gap: 0 !important;
  }

  #sidebar {
    padding-top: 14px !important;
  }

  #sidebar .brand,
  #sidebar .sidebar-brand,
  #sidebar .brand-block,
  #sidebar .logo-wrap,
  #sidebar .app-brand,
  #sidebar .sidebar-header {
    margin-top: 0 !important;
    padding-top: 0 !important;
  }

  #sidebar #composeBtn,
  #sidebar .compose-btn {
    margin-top: 10px !important;
  }
}

@media (max-width: 900px) {
  #sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    z-index: 10000 !important;
    width: min(314px, 88vw) !important;
    max-width: min(314px, 88vw) !important;
    min-width: min(314px, 88vw) !important;
    transform: translateX(-105%) !important;
    opacity: 1 !important;
    visibility: visible !important;
    transition: transform .22s ease !important;
  }

  body.thmail-mobile-sidebar-open #sidebar {
    transform: translateX(0) !important;
    pointer-events: auto !important;
  }

  body:not(.thmail-mobile-sidebar-open) #sidebar {
    pointer-events: none !important;
  }

  #thmailEdgeToggle {
    border-left: 1px solid rgba(12, 32, 61, .18);
  }

  body:not(.thmail-mobile-sidebar-open) #thmailEdgeToggle {
    border-radius: 12px;
  }
}

/* v5.9.4: toda la superficie, incluido el símbolo, activa el botón */
#thmailEdgeToggle,
#thmailEdgeToggle * {
  pointer-events: auto;
}

#thmailEdgeToggle span {
  pointer-events: none !important;
  user-select: none;
  -webkit-user-select: none;
}

#thmailEdgeToggle {
  touch-action: manipulation;
}

/* v5.9.5: flecha alineada al logo y look estable */
#thmailEdgeToggle {
  width: 28px;
  height: 42px;
  background: #17365d !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, .14) !important;
  border-left: none !important;
  border-radius: 0 11px 11px 0 !important;
  box-shadow: 0 5px 14px rgba(6, 20, 40, .18) !important;
  transform: none !important;
}

#thmailEdgeToggle:hover,
#thmailEdgeToggle:focus,
#thmailEdgeToggle:focus-visible,
#thmailEdgeToggle:active {
  background: #17365d !important;
  color: #ffffff !important;
  box-shadow: 0 5px 14px rgba(6, 20, 40, .18) !important;
  transform: none !important;
  outline: none !important;
}

#thmailEdgeToggle span {
  color: inherit !important;
  font-size: 18px;
  font-weight: 700;
}

@media (max-width: 900px) {
  #thmailEdgeToggle {
    border-left: 1px solid rgba(255, 255, 255, .14) !important;
  }

  body:not(.thmail-mobile-sidebar-open) #thmailEdgeToggle {
    border-radius: 11px !important;
  }
}

/* v5.9.6: look final solicitado */
#thmailEdgeToggle {
  width: 28px !important;
  height: 42px !important;
  background: #071f3f !important;
  color: #ffffff !important;
  border: none !important;
  border-left: none !important;
  border-radius: 0 11px 11px 0 !important;
  box-shadow: 0 5px 14px rgba(6, 20, 40, .18) !important;
  transform: none !important;
}

#thmailEdgeToggle:hover,
#thmailEdgeToggle:focus,
#thmailEdgeToggle:focus-visible,
#thmailEdgeToggle:active {
  background: #071f3f !important;
  color: #ffffff !important;
  border: none !important;
  border-left: none !important;
  box-shadow: 0 5px 14px rgba(6, 20, 40, .18) !important;
  transform: none !important;
  outline: none !important;
}

#thmailEdgeToggle span {
  color: #ffffff !important;
}

@media (max-width: 900px) {
  #thmailEdgeToggle {
    border: none !important;
    border-left: none !important;
  }
}

/* v5.9.8: ocultar controles de sidebar fuera de la aplicación */
#thmailEdgeToggle[hidden],
#thmailSidebarOverlay[hidden] {
  display: none !important;
}
